# updateRole

## Overview

Updates a role's name, description, and/or permissions. Name and description are optional — only provided fields are updated. Permissions accept the full desired list; auto-assigned permissions are always preserved.

## Modules Commands Used

- `user-management.updateRole` — Updates role name, description, and/or permissions

## Exception Handling

| Error Code              | Source     | Description                                   |
| ----------------------- | ---------- | --------------------------------------------- |
| ROLE_NOT_FOUND          | updateRole | The specified role does not exist              |
| ROLE_ALREADY_EXISTS     | updateRole | A role with the new name already exists        |
| ROLE_NOT_ACTIVE         | updateRole | The specified role is not in ACTIVE status     |
| MISSING_REQUIRED_FIELD  | updateRole | Role name cannot be empty                      |
| INVALID_PERMISSION      | updateRole | A permission key has an invalid format         |
| INSUFFICIENT_PERMISSION | resolver   | The caller lacks the required permission       |
