Skip to content

Type Alias: RbacContext<T, G> ​

ts
type RbacContext<T, G> = object;

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

What rbacPlugin() adds to the context of every route after it. T (a names type like AppRbac, or typeof rbac) types the names rbac accepts; with per-guard names, G is the guard of the subject.

Type Parameters ​

Type ParameterDefault type
T extends RbacTypeConfig | Rbac<RbacTypeConfig>DefaultRbacTypes
G extends stringDefaultGuardName<TypesOf<T>>

Properties ​

rbac ​

ts
rbac: 
  | SubjectRbac<TypesOf<T>, ScopedGuardName<TypesOf<T>, G>>
  | null;

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

Roles & permissions of the current subject. null for guests.

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