# CANNOT_GRANT_ROLES

> For the complete documentation index, see [llms.txt](https://ensforge.com/llms.txt).

What CANNOT_GRANT_ROLES means, why UnauthorizedError throws it, what to show users and how to fix it in ensforge. Also covers retry safety.

Source: https://ensforge.com/docs/reference/errors/CANNOT_GRANT_ROLES

<ErrorMeta errorClass="UnauthorizedError" href="/docs/reference/errors/unauthorized-error" package="@ensforge/sdk" />

## What happened [#what-happened]

The account cannot grant or revoke these roles.

## What to show users [#what-to-show-users]

| Title | Message | Action |
| --- | --- | --- |
| Permission needed | Your account cannot change these permissions. |  |

## How to fix [#how-to-fix]

Granting a role needs its admin role.

## Retry safety [#retry-safety]

Retrying the same call fails the same way until the cause is fixed (`retryable: false`).

## Actions that throw it [#actions-that-throw-it]

| Action | When |
| --- | --- |
| [`permission.setRecordAccess`](/docs/reference/sdk/permission/set-record-access) | when the account may not grant access. |
| [`role.grant`](/docs/reference/sdk/role/grant) | without the admin roles. |
| [`role.revoke`](/docs/reference/sdk/role/revoke) | without the admin roles. |

## Catch it [#catch-it]

`Errors.hasCode("CANNOT_GRANT_ROLES")` narrows to this error. See [Handle errors](/docs/sdk/handle-errors).