feat(GRO-2513): gate Settings nav+route to manager/super-user, eliminate groomer 403 #82
Reference in New Issue
Block a user
Delete Branch "feature/gro-2513-settings-role-gate"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Gates the Settings surface in the staff admin console to manager/super-user roles only, eliminating the groomer/receptionist 403.
Root cause:
NAV_LINKSinApp.tsxrendered Settings unconditionally for all staff roles, andSettings.tsxfiredGET /api/admin/settingson mount without any role check. The backendrequireRoleOrSuperUser("manager")guard was correct — the web layer was calling it for the wrong roles.Changes:
src/App.tsx—AdminLayoutfetches/api/staff/meon mount; Settings tab only rendered whenrole=manager || isSuperUser(fail-closed while loading);/admin/settingsroute redirects non-managers to/adminsrc/pages/Settings.tsx— replaced two parallel-fireuseEffects with a single sequential flow: user role fetched first, then/api/admin/settingsonly for managers/super-users,/api/admin/auth-provideronly for super-usersUAT_PLAYBOOK.md— updated §5.14 with 8 role-path test cases (TC-WEB-5.14.1–8)Out of scope: no backend changes; no CORS/auth/session/OOBE changes.
Test plan
/api/admin/settings→ 200; no 403 anywhere in network/admin/settingsredirects to/admin; zero 403s in network panel/api/appointments,/api/clients,/api/staff) → 200 for all rolestsc --noEmitpasses (✓ verified locally)Updated UAT_PLAYBOOK.md §5.14 — new role-gated Settings test cases (TC-WEB-5.14.1–8).
🤖 Generated with Claude Code