Add peer review evidence export and restrict AQMM access
This commit is contained in:
@@ -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 = ""):
|
||||
|
||||
Reference in New Issue
Block a user