Skip to content

Type Alias: RbacServer<T, G, A> ​

ts
type RbacServer<T, G, A> = GuardsFor<T, G, A> & object;

Defined in: packages/astro/src/server.ts:170

What createRbacServer() returns: the subject of a request, its snapshot, and the guards.

Type Parameters ​

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

Type Declaration ​

NameTypeDescriptionDefined in
getRbac()(context) => Promise<SubjectRbac<T, ScopedGuardName<T, G>> | null>The subject of this request (SubjectRbac), or null for guests. Resolved once per request: a middleware, a page and its guards call getSubject once.packages/astro/src/server.ts:179
getSnapshot()(context, options?) => Promise<RbacSnapshot | null>The subject's roles and permissions for a client island (<RbacProvider snapshot> of @anievo-id/rbac-evolution-react, or the Vue and Svelte packages), or null for guests.packages/astro/src/server.ts:184

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