TypeScript API / laikacms/auth / hasScope
Function: hasScope()
ts
function hasScope(granted, required): boolean;Does granted satisfy required, accounting for wildcards?
- a global grant (
admin/*) satisfies anything; - an exact match satisfies;
- a
resource:*grant satisfies anyresource:actionon that resource.
Parameters
| Parameter | Type |
|---|---|
granted | readonly Scope[] |
required | Scope |
Returns
boolean