CANNOT_GRANT_ROLES
What CANNOT_GRANT_ROLES means, why UnauthorizedError throws it, what to show users and how to fix it in ensforge. Also covers retry safety.
UnauthorizedErrorNot retryable
@ensforge/sdk
What happened
The account cannot grant or revoke these roles.
What to show users
| Title | Message | Action |
|---|---|---|
| Permission needed | Your account cannot change these permissions. |
How to fix
Granting a role needs its admin role.
Retry safety
Retrying the same call fails the same way until the cause is fixed (retryable: false).
Actions that throw it
| Action | When |
|---|---|
permission.setRecordAccess | when the account may not grant access. |
role.grant | without the admin roles. |
role.revoke | without the admin roles. |
Catch it
Errors.hasCode("CANNOT_GRANT_ROLES") narrows to this error. See Handle errors.
Was this page helpful?