# ReactivateRole

## Permission Scope

role

## Overview

ReactivateRole transitions a role from INACTIVE status back to ACTIVE status. The role resumes granting permissions and can be assigned to users again. Previously preserved RolePermission associations take effect immediately.

Only roles in INACTIVE status can be reactivated.

## Business Rules

- Role must exist in the system
- Role must be in INACTIVE status
- Transitions role status from INACTIVE to ACTIVE
- Preserved RolePermission associations take effect immediately
- Triggers recomputation of effective permissions for users still assigned this role

## Process Flow

```mermaid
flowchart TD
    A[Receive reactivate request] --> B{Role exists?}
    B -->|No| C[Return error: ROLE_NOT_FOUND]
    B -->|Yes| D{Status is INACTIVE?}
    D -->|No| E[Return error: INVALID_STATUS_TRANSITION]
    D -->|Yes| F[Update status to ACTIVE]
    F --> G[Recompute effective permissions for assigned users]
    G --> H[Return updated role]
```

## External Dependencies

- None

## Error Scenarios

- **ROLE_NOT_FOUND**: Specified role ID does not exist
- **INVALID_STATUS_TRANSITION**: Requested status transition is not allowed from the current status

## Test Cases

- throws when role does not exist
- throws when role is already ACTIVE
- reactivates INACTIVE role to ACTIVE
- triggers recomputation of effective permissions
