fix(billing): show permission message when user lacks finance access #73
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/billing-finance-permission"
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 billing list pages call RequireFinance-gated endpoints (allowed roles: super_admin, admin, finance). A user without a finance role got a generic "Could not load" error instead of a clear permission message - unlike the SLA and Audit pages, which gate client-side and show a friendly message.
Fix
Gate the four billing list pages (Invoices, Payments, Tax Rates, Payment Gateways) client-side using
UserRole::can_manage_billing()(super_admin/admin/finance - exact match for the server FinanceRoles). When the current user lacks that role, render a sharedNoFinancePermissionmessage instead of fetching, mirroring the SLA/Audit pattern (.unwrap_or(false)while auth loads).Found during staging verification: the signed-in account lacks finance access, so the invoice list showed the generic error.