Skip to content

Class: RbacAccessError ​

Defined in: packages/trpc/src/errors.ts:20

The cause of the TRPCError a guard throws by default. It carries the RbacErrorBody, which rbacErrorFormatter (or getRbacErrorBody()) puts where clients can read it.

Extends ​

  • Error

Constructors ​

Constructor ​

ts
new RbacAccessError(body): RbacAccessError;

Defined in: packages/trpc/src/errors.ts:27

Parameters ​

ParameterType
bodyRbacErrorBody

Returns ​

RbacAccessError

Overrides ​

Error.constructor

Properties ​

PropertyModifierTypeDefault valueDescriptionDefined in
bodyreadonlyRbacErrorBodyundefinedThe 401 / 403 body of the other integrations.packages/trpc/src/errors.ts:23
codereadonly"RBAC_ACCESS_DENIED"'RBAC_ACCESS_DENIED'-packages/trpc/src/errors.ts:21
statusreadonly401 | 403undefinedHTTP-style status: 401 (no subject) or 403 (missing role/permission).packages/trpc/src/errors.ts:25

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