Follow-up to #25 (whole-branch review minors). OpenSpec change fix-company-scope-fail-closed.
What changes
AdminCompanyScope.scope / requireCompanyForCreate: an admin with no company who is not a super admin gets 403 COMPANY_REQUIRED instead of an all-companies scope.
AppAccessAspect: the module check is skipped only for AdminCompanyScope.isSuper (no company and role 1), not for any holder of role 1.
AdminEmailService: super admins' emails are hidden from every caller who is not a real super admin (same test).
Valid users (super admins, staff with a company) see no difference. Login, first-login, password change, logout and /me don't use the scope, so an invalid user can still sign in and sign out.
Tests
New: AdminCompanyScopeTest.companyLessNonSuper_isRefusedEverywhere, AppAccessAspectAdminTest.companyUserHoldingRole1_getsOnlyTheirOtherRolesModules, AdminEmailServiceTest.detail_companyCallerHoldingRole1_isNotSuper (all red first).
Fixture-only updates to tests that used now-invalid users (company-less staff, company user holding role 1); no assertion weakened (Opus review).
A company user holding role 1 is refused only while role 1 itself has no BO module grants in modules_roles. True locally; real environments unverified.
Deferred: the capture event list still loads only the first 100 enabled events.
Follow-up to #25 (whole-branch review minors). OpenSpec change `fix-company-scope-fail-closed`.
## What changes
- `AdminCompanyScope.scope` / `requireCompanyForCreate`: an admin with no company who is not a super admin gets 403 `COMPANY_REQUIRED` instead of an all-companies scope.
- `AppAccessAspect`: the module check is skipped only for `AdminCompanyScope.isSuper` (no company and role 1), not for any holder of role 1.
- `AdminEmailService`: super admins' emails are hidden from every caller who is not a real super admin (same test).
Valid users (super admins, staff with a company) see no difference. Login, first-login, password change, logout and `/me` don't use the scope, so an invalid user can still sign in and sign out.
## Tests
- New: `AdminCompanyScopeTest.companyLessNonSuper_isRefusedEverywhere`, `AppAccessAspectAdminTest.companyUserHoldingRole1_getsOnlyTheirOtherRolesModules`, `AdminEmailServiceTest.detail_companyCallerHoldingRole1_isNotSuper` (all red first).
- Fixture-only updates to tests that used now-invalid users (company-less staff, company user holding role 1); no assertion weakened (Opus review).
- `mvn -T 1C -q -pl solvway-mobile-api verify`: green, 715 tests.
## Notes
- A company user holding role 1 is refused only while role 1 itself has no BO module grants in `modules_roles`. True locally; real environments unverified.
- Deferred: the capture event list still loads only the first 100 enabled events.
- No UI change; no Playwright run.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
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
ngqile
merged commit a1aa906a66 into main2026-12-01 01:32:09 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #25 (whole-branch review minors). OpenSpec change
fix-company-scope-fail-closed.What changes
AdminCompanyScope.scope/requireCompanyForCreate: an admin with no company who is not a super admin gets 403COMPANY_REQUIREDinstead of an all-companies scope.AppAccessAspect: the module check is skipped only forAdminCompanyScope.isSuper(no company and role 1), not for any holder of role 1.AdminEmailService: super admins' emails are hidden from every caller who is not a real super admin (same test).Valid users (super admins, staff with a company) see no difference. Login, first-login, password change, logout and
/medon't use the scope, so an invalid user can still sign in and sign out.Tests
AdminCompanyScopeTest.companyLessNonSuper_isRefusedEverywhere,AppAccessAspectAdminTest.companyUserHoldingRole1_getsOnlyTheirOtherRolesModules,AdminEmailServiceTest.detail_companyCallerHoldingRole1_isNotSuper(all red first).mvn -T 1C -q -pl solvway-mobile-api verify: green, 715 tests.Notes
modules_roles. True locally; real environments unverified.🤖 Generated with Claude Code
https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM