import { ReflectMetadata } from "@nestjs/common" ; import { PermissionWildcard } from "../guards" ; import { PermissionName , RoleName , RoleWildcard } from "../../db" ; export const AUTHORIZE_METADATA_TOKEN = "authorize" ; export type AuthorizeMetadata = { [ P in RoleName & RoleWildcard ] ? : PermissionName [ ] | PermissionWildcard ; } ; Authorize Authorize Authorize Authorize Authorize export const Authorize = ( metadata = { } ) => ReflectMetadata ( AUTHORIZE_METADATA_TOKEN , metadata ) ;