Add peer review evidence export and restrict AQMM access

This commit is contained in:
A R R R Associates
2026-07-07 14:44:25 +05:30
parent 845784011a
commit 3ed669563a
8 changed files with 640 additions and 4 deletions
+7 -4
View File
@@ -68,11 +68,14 @@ def build_scope(db, request, user) -> AqmmScope:
def can_view_aqmm_dashboard(db, user) -> bool:
"""AQMM dashboard is intentionally restricted to Firm Admin and Partner roles.
Managers/staff may still complete assigned work and review actions through
Work Tracker, but the consolidated AQMM monitoring dashboard is a leadership
view and must not be exposed through broad service/client permissions.
"""
roles = set(get_user_roles(db, user.id))
permissions = set(get_user_permissions(db, user.id))
if roles.intersection({"System Admin", "Firm Admin", "Partner", "Manager", "Branch Manager"}):
return True
return bool(permissions.intersection({"services.view", "clients.view", "audit.view"}))
return bool(roles.intersection({"Firm Admin", "Partner"}))
def _subscription_filters(scope: AqmmScope, financial_year: str = "", q: str = ""):