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

@@ -43,6 +43,13 @@ Babyboo source: `~/Projects/babyboo` (read only). All tasks run serially; most t
- [x] 7.2 Drive the portal in a browser with Playwright against the local stack: login (correct and wrong password), first-login change for a new user, users list/create/edit/deactivate, roles create and grant `BO_USERS`, not-authorised page for a user without `BO_ROLES`, forgot-password message. Screenshots in the change folder's `verification/`. Only local dev data is created. Verify: each scenario observed as specified.
- Scope: `openspec/changes/add-admin-auth-users-roles/verification/**`
## 8. Review follow-up: close self-escalation
- [ ] 8.1 In `mobile-api`: delete `POST /api/admin/users/{id}/changePassword` and `AdminUserService.changePassword`; in `AdminUserService` refuse (403, `OWN_ROLES`) a non-super caller whose update changes the role set on their own account, and refuse (400, `UNKNOWN_ROLE`) `ROLE_ADMIN` or `ROLE_MEMBER` on create and update; in `AdminAclService.updateGrants` refuse (403, `OWN_ROLE`) a non-super caller editing a role they hold, and delete `requireNoLockout`, which that rule makes unreachable. Tests first for each new scenario. Verify: `mvn -T 1C -B -q -pl solvway-mobile-api -am verify` exits 0.
- Scope: `solvway-mobile-api/src/**/admin/**`, `solvway-mobile-api/src/**/service/Admin*`
- [ ] 8.2 In the portal: delete the change-password route, `ChangePasswordDialog`, `changeAdminUserPassword` and the button on the edit-user page; the emailed reset stays. Verify: `npm run lint && npx tsc --noEmit && npx vitest run` exit 0.
- Scope: `solvway-admin-portal/**`
## Workflow follow-up
- Code review, PR to `main`, merge, then archive this change.