Interface: NuxtRbac
Defined in: packages/nuxt/src/runtime/types.ts:16
The RBAC instance provided as $rbac / returned by useRbac().
Extends
VueRbac
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
loading | readonly | Readonly<Ref<boolean>> | true until the first setSnapshot() when created with loading: true (reactive). | VueRbac.loading | packages/vue/dist/index.d.ts:34 |
snapshot | readonly | Readonly<Ref<DeepReadonly<RbacSnapshot>>> | Current snapshot (read-only, reactive). | VueRbac.snapshot | packages/vue/dist/index.d.ts:32 |
Methods
can()
can(permission): boolean;Defined in: packages/vue/dist/index.d.ts:38
true if the user has the permission (or, for a list, ALL of them).
Parameters
| Parameter | Type |
|---|---|
permission | NameList |
Returns
boolean
Inherited from
VueRbac.can
canAll()
canAll(permissions): boolean;Defined in: packages/vue/dist/index.d.ts:41
Parameters
| Parameter | Type |
|---|---|
permissions | NameList |
Returns
boolean
Inherited from
VueRbac.canAll
canAny()
canAny(permissions): boolean;Defined in: packages/vue/dist/index.d.ts:40
Parameters
| Parameter | Type |
|---|---|
permissions | NameList |
Returns
boolean
Inherited from
VueRbac.canAny
cannot()
cannot(permission): boolean;Defined in: packages/vue/dist/index.d.ts:39
Parameters
| Parameter | Type |
|---|---|
permission | NameList |
Returns
boolean
Inherited from
VueRbac.cannot
hasAllRoles()
hasAllRoles(roles): boolean;Defined in: packages/vue/dist/index.d.ts:45
Parameters
| Parameter | Type |
|---|---|
roles | NameList |
Returns
boolean
Inherited from
VueRbac.hasAllRoles
hasAnyRole()
hasAnyRole(roles): boolean;Defined in: packages/vue/dist/index.d.ts:44
Parameters
| Parameter | Type |
|---|---|
roles | NameList |
Returns
boolean
Inherited from
VueRbac.hasAnyRole
hasRole()
hasRole(roles): boolean;Defined in: packages/vue/dist/index.d.ts:43
true if the user has the role, or ANY of the roles. Supports 'writer|editor'.
Parameters
| Parameter | Type |
|---|---|
roles | NameList |
Returns
boolean
Inherited from
VueRbac.hasRole
isGuest()
isGuest(): boolean;Defined in: packages/nuxt/src/runtime/types.ts:20
true when there is no subject (the server resolved a guest, or setSnapshot(null)).
Returns
boolean
isSuperAdmin()
isSuperAdmin(): boolean;Defined in: packages/vue/dist/index.d.ts:47
true if the user has one of the configured superAdminRoles.
Returns
boolean
Inherited from
VueRbac.isSuperAdmin
setSnapshot()
setSnapshot(snapshot): void;Defined in: packages/nuxt/src/runtime/types.ts:18
Replaces the snapshot (and the SSR state), e.g. after login (snapshot) or logout (null).
Parameters
| Parameter | Type |
|---|---|
snapshot | RbacSnapshot | null |
Returns
void
Overrides
VueRbac.setSnapshot
