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:
1 parent
ca98d4dc22
commit
92c8ad3b25
4 files changed
+33
-8
No files matched your search
@@ -47,7 +47,7 @@ The emailed password is plain text in the email body. That is Tastefully's exist
|
||||
|
||||
### 5. Company
|
||||
|
||||
`service-system` gets `company (id, name, created_at)` and `user.company_id BIGINT NULL` (nullable because member rows share the table). `services-system` `User` gains `companyId`. `AdminUserService.create` sets `companyId` from the logged-in admin, ignoring any value in the request. The seed sets company 1 on the dev admin.
|
||||
`service-system` gets `company (id, name, create_date)` and `user.company_id BIGINT NULL` (nullable because member rows share the table). `services-system` `User` gains `companyId`. `AdminUserService.create` sets `companyId` from the logged-in admin, ignoring any value in the request. The seed sets company 1 on the dev admin.
|
||||
|
||||
### 6. Co-Lite back-office modules
|
||||
|
||||
@@ -72,6 +72,8 @@ Delete by directory: every `app/` route, `app/api/` family, `app/components/` fo
|
||||
- [Deleting most of the portal breaks shared imports in ways tests miss] → `npm run build` and `npm run lint` must pass, not only `vitest`.
|
||||
- [Forgot-password takes longer when the details match (bcrypt plus an email), so timing can hint at a match] → Accepted for phase 1; the body is identical either way.
|
||||
- [services-auth issues a token to a deactivated admin] → The admin login checks `enabled` and revokes that token before answering 401; `/user/resetAdminPassword` now refuses deactivated users.
|
||||
- [A non-super admin with `BO_USERS` or `BO_ROLES` could use one module to gain the other] → A non-super admin cannot change their own roles or the grants of a role they hold, and nobody can assign `ROLE_ADMIN` or `ROLE_MEMBER`. They can still give a colleague any visible role; a subset rule (assign only what you hold) is deferred.
|
||||
- [The gateway token bypass for `/user/resetAdminPassword` returns the updated-row count (1 or 0) to anyone with a gateway api-key allowed on `/user/`] → Gateway keys stay internal (mobile-api only); the public endpoint in mobile-api always answers the same.
|
||||
- [Plain-text temporary password in email] → Forced change at next login; revisit with real SMTP in change 5.
|
||||
|
||||
## Migration Plan
|
||||
|
||||
Reference in new issue
Block a user