Skip to content

Payments — permissions ​

Returned by PaymentsModule.get_permissions() (relative names — the registry namespaces them as payments.<name>).

PermissionAllowsRequired by
payments.record.readListing payments, viewing payment details and refund logs, inspecting patient ledgers and pending charges, viewing budget allocations, fetching bulk budget and patient payment summaries, and querying payment status filter lists.GET /, GET /{payment_id}, GET /{payment_id}/refunds, GET /patients/{patient_id}/ledger, GET /patients/{patient_id}/pending-charges, GET /budgets/{budget_id}/allocations, POST /summary/by-budgets, POST /summary/by-patients, GET /filters/budgets-by-status, GET /filters/patients-with-debt.
payments.record.writeRecording patient collections and reallocating payments across budgets or patient on-account credit balances.POST /, POST /{payment_id}/reallocate.
payments.record.refundIssuing payment refunds back to patients.POST /{payment_id}/refunds.
payments.reports.readAccessing payment reports including overview KPI summaries, method breakdowns, professional performance breakdowns, aging receivable debt analysis, refund audit logs, and collection trends over time.GET /reports/summary, GET /reports/by-method, GET /reports/by-professional, GET /reports/aging-receivables, GET /reports/refunds, GET /reports/trends.

Role assignment ​

Declared in the module manifest (backend/app/modules/payments/__init__.py):

RolePermissionsNotes
admin*Full control over payment operations, refunds, and financial reporting.
dentistrecord.read, record.write, record.refund, reports.readFull clinical collection, reallocation, refund processing, and financial reporting.
hygienistrecord.readView payment records and patient ledgers for clinical context.
assistantrecord.read, record.writeRecord patient collections and view ledgers chairside.
receptionistrecord.read, record.write, reports.readFront-desk collections, reallocations, and payment report access; refunds restricted by default.

See backend/app/core/auth/permissions.py for the canonical role table.

Adding a new permission ​

  1. Add the relative name to get_permissions() in backend/app/modules/payments/__init__.py.
  2. Add it to the role mapping in manifest.role_permissions (same file) so the appropriate roles can use it on a fresh install.
  3. Wire the gate on the endpoint via Depends(require_permission("payments.<name>")).
  4. Mirror in frontend/app/config/permissions.ts under PERMISSIONS.payments.* so the UI can call usePermissions().can(PERMISSIONS.payments.<name>).
  5. Add a row to this file with the matching endpoints.
  6. Re-run python backend/scripts/generate_catalogs.py.