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:
@@ -1,4 +1,4 @@
|
||||
"""Tests for GET /users/operators — lead/admin-reachable operator picker list."""
|
||||
"""Tests for GET /users/operators — lead/manager-reachable operator picker list."""
|
||||
|
||||
|
||||
def test_red_lead_can_list_operators(client, red_lead_headers, red_tech_user, blue_tech_user, red_lead_user):
|
||||
@@ -31,3 +31,16 @@ def test_operators_list_excludes_viewers(client, red_lead_headers, db):
|
||||
def test_red_tech_cannot_list_operators(client, red_tech_headers):
|
||||
resp = client.get("/api/v1/users/operators", headers=red_tech_headers)
|
||||
assert resp.status_code == 403
|
||||
|
||||
|
||||
def test_admin_cannot_list_operators(client, auth_headers):
|
||||
"""Admin administers the site — coordinating operators is a lead/manager call."""
|
||||
resp = client.get("/api/v1/users/operators", headers=auth_headers)
|
||||
assert resp.status_code == 403
|
||||
|
||||
|
||||
def test_manager_can_list_operators(client, manager_headers, red_tech_user):
|
||||
resp = client.get("/api/v1/users/operators", headers=manager_headers)
|
||||
assert resp.status_code == 200, resp.text
|
||||
usernames = {u["username"] for u in resp.json()}
|
||||
assert "redtech" in usernames
|
||||
|
||||
Reference in New Issue
Block a user