# Update Role Permissions

## User Story

As a user with the appropriate role, I want to modify a role's permissions, so that access levels stay current.

## Story Diagram

```mermaid
flowchart TD
    A[Open Role List] --> B[Select role]
    B --> C[Click Edit]
    C --> D[Modify permission selection]
    D --> E[Submit]
    E --> F{Validation}
    F -- No permissions selected --> G[Show validation error]
    F -- Valid --> H[Role permissions updated]
```

## Scenario Patterns

- Add one or more permissions to an existing role
- Remove one or more permissions from an existing role
- Submission with no permissions selected is blocked by validation

## Test Cases

- Add a permission to a role and submit; verify the updated permissions are reflected on the role detail
- Remove all user-selected permissions from a role and submit; verify auto-assigned permissions are preserved
- Remove one permission while keeping others and submit; verify the permission is no longer listed on the role

## Screens

- [role-list](../../../screen/role-list.md)
- [role-detail](../../../screen/role-detail.md)
- [role-edit-form](../../../screen/role-edit-form.md)

## Resolvers

- [updateRole](../../../resolver/updateRole.md)
- [availablePermissions](../../../resolver/availablePermissions.md)
