Skip to content

Class: RbacUnauthorizedError ​

Defined in: packages/next/src/errors.ts:4

Thrown by withPermission() / withRole() wrapped server actions when access is denied.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new RbacUnauthorizedError(reason, message?): RbacUnauthorizedError;

Defined in: packages/next/src/errors.ts:10

Parameters ​

ParameterType
reasonFailureReason
message?string

Returns ​

RbacUnauthorizedError

Overrides ​

Error.constructor

Properties ​

PropertyModifierTypeDescriptionDefined in
reasonreadonlyFailureReasonunauthenticated (no subject) or unauthorized (missing role/permission).packages/next/src/errors.ts:6
statusreadonly401 | 403HTTP-style status: 401 or 403.packages/next/src/errors.ts:8

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