Skip to content

Type Alias: WildcardPrefixCheck ​

ts
type WildcardPrefixCheck = "warn" | "error" | "off";

Defined in: packages/core/src/wildcard.ts:106

What the engine does when, with wildcard: true, one permission name implies another only because it is shorter (orders.refund implies orders.refund.large). See RbacOptions.wildcardPrefixCheck.

  • 'warn': log a one-time console.warn per pair when NODE_ENV is development (the default).
  • 'error': throw an RbacError with code INVALID_WILDCARD_PERMISSION, before anything is written.
  • 'off': say nothing.

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