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:
@@ -143,14 +143,15 @@ def test_review_red_reopen_moves_to_red_executing(
|
||||
assert body["red_review_notes"] == "add more detail"
|
||||
|
||||
|
||||
def test_review_red_admin_can_always_act(
|
||||
def test_review_red_forbidden_for_admin(
|
||||
client, db, api, auth_headers, red_tech_headers, red_lead_user, technique
|
||||
):
|
||||
"""Admin administers the site, not the test workflow — reviewing is a
|
||||
red_lead-only action now, with no admin override."""
|
||||
test_id = _reach_red_review(client, db, api, auth_headers, red_tech_headers, technique)
|
||||
|
||||
resp = api("post", f"/api/v1/tests/{test_id}/review-red", auth_headers, json={"decision": "approve"})
|
||||
assert resp.status_code == 200, resp.text
|
||||
assert resp.json()["state"] == "blue_evaluating"
|
||||
assert resp.status_code == 403
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user