Function: isPermissionName()
ts
function isPermissionName<T, G>(
rbac,
value,
options?
): value is PermissionName<T, G>;Defined in: packages/core/src/names.ts:132
true if value is one of the permission names listed in createRbac({ names: { permissions } }), and narrows it to the engine's PermissionName<T>. Same rules as isRoleName: exact names from the list, no database query, a TypeError if the engine has no names.permissions, and { guard } for per-guard lists.
Type Parameters
| Type Parameter | Default type |
|---|---|
T extends RbacTypeConfig | - |
G extends string | DefaultGuardName<T> |
Parameters
| Parameter | Type |
|---|---|
rbac | Rbac<T> |
value | unknown |
options? | GuardOptions<CheckGuard<T, G>> |
Returns
value is PermissionName<T, G>
