Skip to content

IAccessControlErrorOptions

Defined in: src/core/AccessControlError.ts:6

Options for constructing an AccessControlError. Extends the standard ErrorOptions (so a cause can be attached) with optional structured context for programmatic handling.

  • ErrorOptions

optional code?: string

Defined in: src/core/AccessControlError.ts:12

Stable, machine-readable code for programmatic handling. Branch on this instead of parsing message (messages are redacted by default and may change wording). See ErrorCode.


optional role?: string | string[]

Defined in: src/core/AccessControlError.ts:14

The role(s) this error relates to, if any.


optional resource?: string

Defined in: src/core/AccessControlError.ts:16

The resource this error relates to, if any.


optional action?: string

Defined in: src/core/AccessControlError.ts:18

The action this error relates to, if any.


optional asyncRequired?: boolean

Defined in: src/core/AccessControlError.ts:24

Set when the fault is “this check needs the async path” — i.e. an applicable rule/gate carries a custom/async { fn } condition. The engine uses it to defer such checks to grantedAsync/checkAsync.


optional cause?: unknown

Defined in: site/node_modules/typescript/lib/lib.es2022.error.d.ts:20

ErrorOptions.cause