Type Alias: RbacRequest<T, Req, G>
ts
type RbacRequest<T, Req, G> = Omit<Req, "rbac"> & object;Defined in: packages/fastify/src/plugin.ts:49
A Fastify request whose rbac has the names of T (a names type like AppRbac, or typeof rbac). With per-guard names, G is the guard of the request (the default guard's names by default): RbacRequest<typeof rbac, FastifyRequest, 'api'> on the routes of an api middleware. For typing a handler without a global RbacRegister, e.g. when two plugins use different engines:
ts
app.get('/articles', async (request: RbacRequest<typeof rbac>) => { ... })Type Parameters
| Type Parameter | Default type |
|---|---|
T extends RbacTypeConfig | Rbac<RbacTypeConfig> | DefaultRbacTypes |
Req | FastifyRequest |
G extends string | DefaultGuardName<TypesOf<T>> |
Type Declaration
| Name | Type | Description | Defined in |
|---|---|---|---|
rbac? | | SubjectRbac<TypesOf<T>, ScopedGuardName<TypesOf<T>, G>> | null | Roles & permissions of the current subject, set by the rbac-evolution plugin. null for guests, undefined when the plugin did not run for this request. | packages/fastify/src/plugin.ts:58 |
