# 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 permissions from a role and submit; verify a validation error is shown and the role is not updated
- 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

- [assignPermissionToRole](../../../resolver/assignPermissionToRole.md)
- [revokePermissionFromRole](../../../resolver/revokePermissionFromRole.md)
