feat(admin): staff pages, invitation accept and Operations role (#134) #141
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/kws!141
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/admin-staff-pages"
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?
Closes the admin side of #134: the Super Admin can now invite the operations team (and later finance) from the portal, and the invited person accepts from the email link.
Design:
docs/superpowers/specs/2026-11-02-admin-staff-pages-design.md· Plan:docs/superpowers/plans/2026-11-02-admin-staff-pages.mdWhat changes
API
admin_portal.access,reports.view,tickets.scan; noadministration.manage). Applied byKWS_MODE=migrate. Dictionaries and the catalogue stay with Admin.GET /v1/admin/usersitems are nowStaffUser(withmemberships[].roles), read in the same query (sharedmembershipsCol, no N+1).StaffUserSummaryis removed from the spec; the contract test asserts memberships.Admin portal (
web/apps/admin/src/staff/)/staff: search, status filter, Load more, Edit roles grouped by application (one PUT per changed application, a partial failure names the unsaved group), Deactivate / Reactivate with in-page confirmation./staff-invitations: invite by email with one or more roles (Idempotency-Keyper open form, reused on retry), revoke; fixed texts for every 409 code and the "email not set up" 503./accept-invitation(outsideRequireAccess): token read from the hash and removed from the address bar, carried through sign-in in the OIDCstate, exactly one accept POST (StrictMode-safe); shows granted roles, links home only with admin access.admin_portal.administration.manageat platform scope. No server text reaches the screen.Dev
axllent/mailpit:v1.31.6, loopback ports 1025/8025) incompose.dev.yml; README explains theKWS_SMTP_*values for API and worker, and thatadmin_portal_urlmust be https (https://localhost:5173, open the emailed link with http).kws-admin-webtokens now getaud: kws-api(admin dev sign-in was 401).Verification
make cover: 91.6 % total (minimum 80 %);make lint: 0 issues;make contractok.scripts/web-e2e.sh: ticket 207, admin 113 passed (run before the final refactor commit, which touches no e2e file). On macOS run it withCOPYFILE_DISABLE=1.ops.one@example.testas Operations → Mailpit email → accept → roles shown,#cleared, menu = Transactions only,/staff= no permission, invitationused, token in no API/worker/dev-server log.Known and deferred
🤖 Generated with Claude Code