fix(billing): standardised 403 permission-required UI on Contracts + Rate Cards (MAPPS-271) #314
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-apps!314
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/MAPPS-271-standardize-403-permission-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?
The Invoices and Payments lists already short-circuited to a friendly locked-state empty UI when the signed-in user lacked
can_manage_billing(). The Contracts and Rate Cards lists did not - their server endpoints (list_contracts,list_rate_cards) are bothRequireFinance-gated, so a non-finance role hit a 403, fell through to the generic "Could not load X. Refresh the page to retry." sentence, and the user could not tell whether the failure was transient or a permission boundary. The QA report specifically flagged this.Lift the existing
NoFinancePermissionshape into a sharedPermissionRequiredcomponent (src/components/permission_state.rs) parameterised on title + body, then short-circuit the ContractListPage and RateCardListPage to that component whenuse_can_manage_billing()is false. The user now sees the same posture across all four billing-adjacent lists: an icon, a clear heading naming the gated surface, a one-line explanation, and the viewer's current role for context.PMS-447 (deployed) floor-promotes Bunyip subscribers to Mokosh Admin (which passes
can_manage_billing()), so most real users won't hit this branch any more. The standardised UI still matters for tenant-internal role-grant changes, and was the QA's specific request. The Invoices / Payments pages keep their existingNoFinancePermissionrendering for now - the messaging is identical, just the component name differs; a future refactor can collapse them, this PR doesn't touch the already-correct surfaces.#MAPPS-271