docs(openspec): close admin self-escalation found in review

A non-super admin cannot change their own roles or the grants of a role they hold,
hidden roles cannot be assigned, and the direct set-password endpoint goes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
ngqileandClaude Opus 5.5 committed 2026-11-26 22:22:49 +08:00
1 parent ca98d4dc22
commit 92c8ad3b25
4 files changed
+33 -8

No files matched your search

@@ -23,7 +23,7 @@ The system SHALL let an admin with `BO_ROLES` list, create and rename admin role
### Requirement: Role permissions
The system SHALL let an admin with `BO_ROLES` choose, for a role, which back-office modules it grants, shown as the module tree. Saving SHALL replace the role's module grants with the chosen set. The grants of the super admin role and of `ROLE_ADMIN` SHALL NOT be editable.
The system SHALL let an admin with `BO_ROLES` choose, for a role, which back-office modules it grants, shown as the module tree. Saving SHALL replace the role's module grants with the chosen set. The grants of the super admin role and of `ROLE_ADMIN` SHALL NOT be editable. An admin who is not super admin SHALL NOT change the grants of a role they hold.
#### Scenario: Grant Users module
@@ -32,11 +32,11 @@ The system SHALL let an admin with `BO_ROLES` choose, for a role, which back-off
- **THEN** users with `ROLE_SALES` see Users in the sidebar after their next login or session refresh
- **AND** `GET /api/admin/users` responds 200 for them
#### Scenario: Self lock-out
#### Scenario: Own role
- **GIVEN** the admin's only role that grants `BO_ROLES` is the role being edited
- **WHEN** they remove `BO_ROLES` from it and save
- **THEN** the save is refused with a message, so no admin loses access to role management by mistake
- **GIVEN** an admin who is not super admin and holds `ROLE_SALES`
- **WHEN** they change the module grants of `ROLE_SALES` and save
- **THEN** the save is refused with a message, so no admin can widen their own access or lock themselves out of role management
### Requirement: Back-office module set