fix(team): hide invite role picker until RBAC is complete (PMS-513) #347
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-513-disable-role-assignment-ui"
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?
What
Hides role assignment in the team invite form (
src/pages/team.rs, route/admin/team) behind a single module-level flagROLE_ASSIGNMENT_ENABLED(currentlyfalse), so new invitations go out as the lowest-privilege role (Technician) until full RBAC is complete. Implements PMS-513.Why
The invite form offered all six assignable roles, but role-based access is only partially enforced server-side:
RequireAdmin(super_admin/admin),RequireManager(+manager) andRequireFinance(+finance) gate specific routes, whiletechnician,dispatcherandsalescarry no distinct authority at all. Offering roles whose permission semantics are incomplete is misleading and risks granting unexpected access the moment the rest of RBAC lands.Change
UI-only. While the flag is
false: the invite form renders email + submit only (grid collapsessm:grid-cols-3tosm:grid-cols-2), therolesignal keeps its existing"technician"default sohandle_inviteposts{ email, role: "technician" }, androle_optionsis built only when the flag istrueso it does not warn as unused. Re-enabling the picker is a one-line flag flip; the markup and full taxonomy are kept. The mokosh-server invite endpoint is untouched (the client simply never sends a non-default role), and the role-based access checks (is_admin/can_manage_billing) are unchanged.Server-side clamping of the invite role was deliberately deferred: mokosh-apps is the only invite client and the goal is to stop exposing the choice, not to harden against crafted requests (YAGNI; tracked as a possible follow-up if the API gains other clients).
Verification
approver_rolefield intickets.rsis approval routing ("pick a specific approver OR enter a role"), not an RBAC role grant;auth.rs/models.rsonly parse/read roles.just checkparity via the rust-builder image:cargo clippy --all-targets -- -D warningsclean,cargo fmt --checkclean, theme-token scan clean,cargo check --target wasm32-unknown-unknownclean.Docs
dev-docs/codebase-state.md: catalogue the previously-missing/admin/teamroute with the gating noted.PMS-A-3("mokosh roles and RBAC: what is actually enforced today") documents the current enforcement reality and this gating decision.Acceptance criteria
is_admin/can_manage_billing) are unchanged.