Skip to content

Interface: RbacModuleOptions<T> ​

Defined in: packages/nestjs/src/options.ts:10

T is the engine's names type (createRbac<AppRbac>()), inferred from rbac. Nest's parameter decorators can't carry it to @CurrentRbac(): type the parameter as SubjectRbac<AppRbac> (see createRbacDecorators).

Extended by ​

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfigDefaultRbacTypes

Properties ​

PropertyTypeDescriptionDefined in
exposeRequirements?booleanInclude the required roles/permissions in the 403 body (required). Default: false (like spatie's display_permission_in_exception).packages/nestjs/src/options.ts:26
getSubject(context) => MaybePromise<Subject | null | undefined>Resolves the authenticated subject for this execution context (e.g. from request.user). Return null / undefined for guests.packages/nestjs/src/options.ts:17
guard?stringRBAC guard name (e.g. web or api) — not a Nest guard. Defaults to the engine's defaultGuard.packages/nestjs/src/options.ts:19
rbacRbac<T>The RBAC engine created with createRbac(...).packages/nestjs/src/options.ts:12
team?(context) => MaybePromise<TeamId | undefined>Resolves the current team (only when the engine was created with teams: true).packages/nestjs/src/options.ts:21

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