feat(staff): super user grant/revoke UI + last-super-user guardrail (GRO-206) #175

Closed
the-dogfather-cto[bot] wants to merge 9 commits from fix/gro-206-superuser-revoke-bug into main

9 Commits

Author SHA1 Message Date
Barkley Trimsworth c0e9c37982 ci: restore workflow_dispatch for manual CI trigger
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 13:55:55 +00:00
Barkley Trimsworth 7fdb32f95b fix(GRO-206): CTO review fixes — active filter on super user count + CI TAG fix
- Add active=true filter to all 3 super user count queries in staff.ts
  (revoke, deactivate, delete) so inactive super users aren't counted
- Fix ci.yml deploy step: use steps.version.outputs.tag instead of
  invalid github.sha::7 expression
- Remove GRO-206 CI trigger junk line from README.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 13:55:00 +00:00
groombook-ci[bot] c6a08be4c6 chore: trigger PR CI for GRO-206
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 12:37:44 +00:00
groombook-ci[bot] 0098e36fa6 ci: trigger PR CI for GRO-206
Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 12:30:10 +00:00
groombook-ci[bot] 4662b44ccc ci: remove workflow_dispatch (not needed) 2026-03-30 11:11:59 +00:00
groombook-ci[bot] 1bdc6d50be ci: add workflow_dispatch trigger for manual runs 2026-03-30 11:05:30 +00:00
groombook-ci[bot] 1ba840d003 ci: trigger build 2026-03-30 11:05:30 +00:00
groombook-ci[bot] f7dfe4a526 feat(staff): super user grant/revoke UI + last-super-user guardrail (GRO-206)
Backend:
- PATCH /api/staff/:id now accepts optional isSuperUser field
- Only super users can change isSuperUser (403 otherwise)
- Revoke (isSuperUser=false) blocked if target is last super user (400)
- Deactivate (active=false) blocked if target is last super user (400)
- DELETE /:id blocked if target is last super user (400)
- New GET /api/staff/me returns current authenticated staff record

Frontend (Staff.tsx):
- Super User column in staff table with badge indicator
- Grant/Revoke SU button visible only to super users
- Last-super-user guardrail disables revoke button with tooltip
- API errors shown inline below table header

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-30 11:05:30 +00:00
groombook-ci[bot] 1de57f0a40 fix(ci): include GitHub SHA in image tag to prevent stale cache reuse
Each CI build now produces an immutable tag (pr-N-sha7 or
YYYY.MM.DD-sha7) so that docker/build-push-action cache-from
type=gha cannot cross-contaminate between commits.

Previously the shared pr-N tag caused GHA layer cache to reuse
stale JS bundles from earlier builds of the same PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-30 11:05:30 +00:00