Skip to content

Interface: RbacLocals<T, G> ​

Defined in: packages/sveltekit/src/server/handle.ts:46

What rbacHandle() puts on event.locals. Extend App.Locals with it in src/app.d.ts:

ts
import type { RbacLocals } from '@anievo-id/rbac-evolution-sveltekit/server'
import type { AppRbac } from '$lib/server/rbac'

declare global {
  namespace App {
    interface Locals extends RbacLocals<AppRbac> {}
  }
}

T is a names type like AppRbac (or typeof rbac); without it, any name. With per-guard names, G is the guard of the hook (its guard option): the default guard's names by default.

Type Parameters ​

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

Properties ​

PropertyTypeDescriptionDefined in
rbac| SubjectRbac<TypesOf<T>, ScopedGuardName<TypesOf<T>, G>> | nullRoles & permissions of the current subject. null for guests.packages/sveltekit/src/server/handle.ts:51

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