feat(permissions): admin no longer acts on the test workflow; managers coordinate operators
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Aegis CI / lint-and-test (push) Has been cancelled
Snyk Security Scan / Python vulnerabilities (backend) (push) Has been cancelled
Snyk Security Scan / npm vulnerabilities (frontend) (push) Has been cancelled
Snyk Security Scan / Docker image vulnerabilities (backend) (push) Has been cancelled
Admin administers the site — it no longer has any override on
validate-red/blue, review-red/blue, resolve-dispute, request-discussion,
reopen, hold, resume, assign-operators, or classification-update.
Introduces require_any_role_strict(), a role dependency without the
global admin bypass, so these specific endpoints truly exclude admin
instead of only removing it from the (redundant) role tuple.
Managers gain the ability to assign red_tech/blue_tech operators
(POST /tests/{id}/assign, GET /users/operators) alongside leads, since
that's coordination, not resolving a ticket.
Also enlarges and repositions the operator-assignment controls next
to the Start Execution button, and fixes a literal '\u2014' rendering
as text instead of an em dash in the test detail technique line.
This commit is contained in:
@@ -829,7 +829,9 @@ class TestResolveDispute:
|
||||
resolve_dispute(db, test, red_lead, "purple")
|
||||
|
||||
@patch("app.services.test_workflow_service.log_action")
|
||||
def test_admin_can_resolve_dispute_regardless_of_vote(self, mock_log):
|
||||
def test_admin_cannot_resolve_dispute(self, mock_log):
|
||||
"""Admin administers the site — only the lead who approved may flip
|
||||
their vote, with no admin override."""
|
||||
test = _make_test(
|
||||
TestState.disputed,
|
||||
red_validation_status="approved",
|
||||
@@ -839,8 +841,8 @@ class TestResolveDispute:
|
||||
db = _make_db()
|
||||
|
||||
from app.services.test_workflow_service import resolve_dispute
|
||||
result = resolve_dispute(db, test, admin, "red")
|
||||
assert result.state == TestState.red_executing
|
||||
with pytest.raises(InvalidOperationError):
|
||||
resolve_dispute(db, test, admin, "red")
|
||||
|
||||
|
||||
# ===========================================================================
|
||||
|
||||
Reference in New Issue
Block a user