Skip to content

Variable: CurrentRbac ​

ts
const CurrentRbac: () => ParameterDecorator;

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

Injects the current subject's SubjectRbac (null for guests), as resolved by RbacGuard.

ts
@Get('me/permissions')
@UseGuards(RbacGuard)
snapshot(@CurrentRbac() rbac: SubjectRbac | null) {
  return rbac?.snapshot() ?? null
}

Returns ​

ParameterDecorator

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