LocChat/server/decorators/roles.decorator.ts

6 lines
229 B
TypeScript
Raw Normal View History

2021-12-01 22:18:26 -05:00
import { SetMetadata } from '@nestjs/common';
import { RoleKey } from 'server/entities/role.entity';
export const ROLES_CONTEXT_KEY = 'roles';
export const Roles = (...roles: RoleKey[]) => SetMetadata(ROLES_CONTEXT_KEY, roles);