Skip to content

Function: createRbacChecker() ​

ts
function createRbacChecker(snapshot, options?): RbacChecker;

Defined in: packages/sveltekit/src/checker.ts:67

Builds a pure checker for a snapshot (as returned by getSnapshot(event) / rbac.for(user).snapshot()). setRbacContext() uses it; use it on its own in a universal load (+page.ts) with the layout's data.

Parameters ​

ParameterType
snapshotRbacSnapshot | null | undefined
options?RbacCheckerOptions

Returns ​

RbacChecker

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