Created
September 10, 2021 03:46
-
-
Save minhntm/8ffe1c6c704593a3dd0a24e0b1604952 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CustomDecorator, SetMetadata } from "@nestjs/common"; | |
// action, object | |
export type RequiredPermission = [PermissionAction, PermissionObjectType] | |
export const PERMISSION_CHECKER_KEY = "permission_checker_params_key"; | |
export const CheckPermissions = (...params: RequiredPermission[]): CustomDecorator<string> => | |
SetMetadata(PERMISSION_CHECKER_KEY, params); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment