Skip to content

Interface: RbacContextOptions<I, T, G> ​

Defined in: packages/trpc/src/context.ts:44

Type Parameters ​

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

Properties ​

PropertyTypeDescriptionDefined in
getSubject(input) => MaybePromise<Subject | null | undefined>Resolves the authenticated subject from what you pass to the returned function (your user, the request, the createContext options, ...). Return null / undefined for guests.packages/trpc/src/context.ts:55
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 ctx.rbac gets its names.packages/trpc/src/context.ts:60
rbacRbac<T>The RBAC engine created with createRbac(...). Its typed names flow into ctx.rbac.packages/trpc/src/context.ts:50
team?(input) => MaybePromise<TeamId | undefined>Resolves the current team (only when the engine was created with teams: true).packages/trpc/src/context.ts:62

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