This commit is contained in:
Shubhankar45
2026-10-27 12:03:31 +00:00
parent 2ed3945b5d
commit 4e5e95775d
104 changed files with 5210 additions and 606 deletions
+3 -2
View File
@@ -10,7 +10,7 @@ The Area Manager is the final approver; there is no General Manager stage.
from dataclasses import dataclass
from app.common.enums import EDITABLE_STATUSES, DCRStatus, Role, WorkflowAction
from app.common.enums import EDITABLE_STATUSES, FIELD_ROLES, DCRStatus, Role, WorkflowAction
from app.common.exceptions import ForbiddenError, InvalidStateTransitionError
@@ -62,7 +62,8 @@ def assert_transition(status: DCRStatus, action: WorkflowAction, role: Role) ->
),
},
)
if transition.allowed_role != role:
# An SFE files and submits reports exactly as an MR does.
if transition.allowed_role != (Role.MR if role in FIELD_ROLES else role):
raise ForbiddenError(
f"Role {role.value} may not {action.value.lower()} this report",
{"required_role": transition.allowed_role.value, "your_role": role.value},