Files
co-lite/openspec/changes/fix-company-scope-fail-closed/tasks.md
T
ngqileandClaude Opus 5.5 998e04b844 fix(mobile-api): fail closed for admins outside the company model
An admin with no company who is not a super admin now gets 403
COMPANY_REQUIRED on every company-scoped request instead of seeing all
companies. The module check and the email detail treat only a real super
admin (no company and role 1) as super; a company user still holding
role 1 gets only what their other roles grant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
2026-12-01 09:31:55 +08:00

11 lines
657 B
Markdown

## 1. Fail closed
- [x] 1.1 `AdminCompanyScope.scope` and `requireCompanyForCreate` refuse (403 `COMPANY_REQUIRED`) an admin with no company who is not a super admin
- Depends on: none
- Scope: `solvway-mobile-api/src/**/useraccess/AdminCompanyScope*.java`
- Verify: `mvn -T 1C -q -pl solvway-mobile-api verify`
- [x] 1.2 `AppAccessAspect` skips the module check only for `AdminCompanyScope.isSuper`; `AdminEmailService` uses the same test
- Depends on: 1.1
- Scope: `solvway-mobile-api/src/**/useraccess/AppAccessAspect*.java`, `solvway-mobile-api/src/**/service/AdminEmailService*.java`
- Verify: `mvn -T 1C -q -pl solvway-mobile-api verify`