Interface: RbacModuleConfig<T>
Defined in: packages/nestjs/src/options.ts:37
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).
Extends
RbacModuleOptions<T>GlobalGuardOption
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends RbacTypeConfig | DefaultRbacTypes |
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
exposeRequirements? | boolean | Include the required roles/permissions in the 403 body (required). Default: false (like spatie's display_permission_in_exception). | RbacModuleOptions.exposeRequirements | 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. | RbacModuleOptions.getSubject | packages/nestjs/src/options.ts:17 |
globalGuard? | boolean | Register RbacGuard as a global guard (APP_GUARD), so every route resolves the subject (and @CurrentRbac() works without a @Require* decorator). Default: false. | GlobalGuardOption.globalGuard | packages/nestjs/src/options.ts:34 |
guard? | string | RBAC guard name (e.g. web or api) — not a Nest guard. Defaults to the engine's defaultGuard. | RbacModuleOptions.guard | packages/nestjs/src/options.ts:19 |
rbac | Rbac<T> | The RBAC engine created with createRbac(...). | RbacModuleOptions.rbac | packages/nestjs/src/options.ts:12 |
team? | (context) => MaybePromise<TeamId | undefined> | Resolves the current team (only when the engine was created with teams: true). | RbacModuleOptions.team | packages/nestjs/src/options.ts:21 |
