Skip to content

Interface: RbacRouteRule ​

Defined in: packages/nuxt/src/runtime/rule.ts:13

definePageMeta({ rbac: { ... } }) — same semantics as the Express / Nest guards.

Properties ​

PropertyTypeDescriptionDefined in
all?booleanRoles: require ALL of them instead of any.packages/nuxt/src/runtime/rule.ts:23
any?booleanPermissions: pass with ANY of them instead of all.packages/nuxt/src/runtime/rule.ts:21
guestRedirect?stringWhere to send a guest. Default: the module's unauthenticatedRedirect, else a 401 error page.packages/nuxt/src/runtime/rule.ts:27
permission?RequirementNamesEvery name is required; 'a|b' = any of them. With any: true, any of all the names.packages/nuxt/src/runtime/rule.ts:15
redirect?stringWhere to send a user who lacks access. Default: the module's forbiddenRedirect, else a 403 error page.packages/nuxt/src/runtime/rule.ts:25
role?RequirementNamesAny of the roles; with all: true, all of them. 'a|b' is supported.packages/nuxt/src/runtime/rule.ts:17
roleOrPermission?RequirementNamesAny of the names, as a role OR as a permission.packages/nuxt/src/runtime/rule.ts:19

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