fix(billing): show permission message when user lacks finance access #73

Merged
vas2000-work merged 2 commits from fix/billing-finance-permission into main 2026-06-05 23:09:33 +02:00
Owner

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 shared NoFinancePermission message 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.

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 shared `NoFinancePermission` message 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.
fix(billing): show a permission message when the user lacks finance access
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 41s
2c23255fa8
The billing list pages call RequireFinance-gated endpoints (super_admin/admin/finance); a user without that role got a generic "Could not load" error. Gate the list pages client-side like the SLA and Audit pages do, rendering a clear permission message instead of fetching when the current user lacks finance access.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Merge branch 'main' into fix/billing-finance-permission
All checks were successful
Create release / Create release from merged PR (pull_request) Has been skipped
Check / clippy + fmt + tests (pull_request) Successful in 49s
4ffbaa3aba
vas2000-work deleted branch fix/billing-finance-permission 2026-06-05 23:09:33 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!73
No description provided.