Skip to content

Interface: RbacPluginOptions<T, G> ​

Defined in: packages/elysia/src/plugin.ts:43

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfigDefaultRbacTypes
G extends stringDefaultGuardName<T>

Properties ​

PropertyTypeDescriptionDefined in
getSubject(ctx) => MaybePromise<Subject | null | undefined>Resolves the authenticated subject for this request (e.g. from a session cookie or a JWT payload). Return null / undefined for guests.packages/elysia/src/plugin.ts:50
guard?GGuard name (e.g. web or api). Defaults to the engine's defaultGuard. With per-guard names, it must be one of the typed guards, and the rbac context value gets its names.packages/elysia/src/plugin.ts:55
name?stringPlugin name, used by Elysia to register it once. Default: 'rbac-evolution'. Give each instance its own name when you register two (e.g. a web and an api guard).packages/elysia/src/plugin.ts:62
rbacRbac<T>The RBAC engine created with createRbac(...). Its typed names flow into the rbac context value.packages/elysia/src/plugin.ts:45
team?(ctx) => MaybePromise<TeamId | undefined>Resolves the current team (only when the engine was created with teams: true).packages/elysia/src/plugin.ts:57

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