Skip to content

Interface: ScopedRbacDecorators<T, G> ​

Defined in: packages/nestjs/src/decorators.ts:158

The decorators of createRbacDecorators<T, G>() when T has per-guard names (RbacTypeConfig['guards']): like RbacDecorators, but the names are those of the guard each decorator checks in, its { guard } option or else G (the guard of the resolved subject, RbacModule's guard). @RequirePermissions('orders.read', { guard: 'api' }) takes the api names.

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfig-
G extends stringDefaultGuardName<T>

Properties ​

PropertyTypeDescriptionDefined in
CanAll<A>(...args) => <TFunction, Y>(target, propertyKey?, descriptor?) => voidRbacDecorators.CanAll, with the names of the guard it checks in.packages/nestjs/src/decorators.ts:176
CanAny<A>(...args) => <TFunction, Y>(target, propertyKey?, descriptor?) => voidRbacDecorators.CanAny, with the names of the guard it checks in.packages/nestjs/src/decorators.ts:172
RequirePermissions<A>(...args) => <TFunction, Y>(target, propertyKey?, descriptor?) => voidRbacDecorators.RequirePermissions, with the names of the guard it checks in.packages/nestjs/src/decorators.ts:160
RequireRoleOrPermission<A>(...args) => <TFunction, Y>(target, propertyKey?, descriptor?) => voidRbacDecorators.RequireRoleOrPermission, with the names of the guard it checks in.packages/nestjs/src/decorators.ts:168
RequireRoles<A>(...args) => <TFunction, Y>(target, propertyKey?, descriptor?) => voidRbacDecorators.RequireRoles, with the names of the guard it checks in.packages/nestjs/src/decorators.ts:164

Released under the MIT License. Inspired by spatie/laravel-permission.