# deactivateRole

## Overview

Deactivates a role, preventing new user assignments. Only ACTIVE roles with no active user assignments can be deactivated.

## Modules Commands Used

- `user-management.deactivateRole` — Changes role status from ACTIVE to INACTIVE

## Exception Handling

| Error Code                   | Description                                       |
| ---------------------------- | ------------------------------------------------- |
| ROLE_NOT_FOUND               | The specified role does not exist                 |
| INVALID_STATUS_TRANSITION    | The role is not in ACTIVE status                  |
| ROLE_HAS_ACTIVE_ASSIGNMENTS  | The role still has active user assignments         |
