Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforge

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

TitleMessageAction
Permission neededYour 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

ActionWhen
permission.setRecordAccesswhen the account may not grant access.
role.grantwithout the admin roles.
role.revokewithout the admin roles.

Catch it

Errors.hasCode("CANNOT_GRANT_ROLES") narrows to this error. See Handle errors.

Was this page helpful?