fix(auth): enforce role boundaries on data quality and audit
The data-quality workbench (list, detail, defer, reject) and the audit trail had no role gate at all beyond authentication -- confirmed live, a Rental Employee session could list and resolve data-quality issues and read the full audit trail through both the API and the UI, with only merge-customers and scan already restricted. Per the role matrix, both areas are Operations-Manager-only. Gate the remaining data-quality and audit endpoints with require_operations_manager, hide their nav items for Rental Employee, show the same restricted-message pattern Automation.tsx already used for direct URL access, and stop the dashboard from linking into now-restricted areas for that role.
This commit is contained in:
@@ -9,3 +9,8 @@ def test_demo_login_is_audited(ops_client):
|
||||
def test_audit_requires_authentication(client):
|
||||
response = client.get("/api/v1/audit")
|
||||
assert response.status_code == 401
|
||||
|
||||
|
||||
def test_audit_requires_operations_manager(employee_client):
|
||||
response = employee_client.get("/api/v1/audit")
|
||||
assert response.status_code == 403
|
||||
|
||||
Reference in New Issue
Block a user