Interface: RbacContextOptions<I, T, G>
Defined in: packages/trpc/src/context.ts:44
Type Parameters
| Type Parameter | Default type |
|---|---|
I | unknown |
T extends RbacTypeConfig | DefaultRbacTypes |
G extends string | DefaultGuardName<T> |
Properties
| Property | Type | Description | Defined 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? | G | Guard 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 |
rbac | Rbac<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 |
