Skip to content

Function: wildcardImplies() ​

ts
function wildcardImplies(granted, required): boolean;

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

Returns true when the granted permission covers the required one.

  • * covers everything.
  • articles.* covers articles.edit, articles.edit.own, ...
  • articles covers articles.edit (a shorter permission implies everything below it).
  • articles.edit,delete covers articles.edit and articles.delete, not articles.create.
  • articles.edit does NOT cover articles.* or articles.

Parameters ​

ParameterType
grantedstring
requiredstring

Returns ​

boolean

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