Authorize operation details by admin scope and isolate scoped clients

This commit is contained in:
Pigway
2026-10-06 22:27:26 +08:00
parent d9d9992e40
commit 28b154091c
4 changed files with 50 additions and 3 deletions
+16
View File
@@ -125,3 +125,19 @@ def test_openapi_describes_cookie_auth_and_docs_csrf(client):
"security"
]
assert "X-CSRF-Token" in client.get("/docs").text
def test_browser_admin_can_read_other_clients_operation(client, app, service):
operation_id = service.submit(
"render",
{"template": "quote"},
"living-room",
"scheduler",
"fixture-request",
None,
)
assert login(client, app).status_code == 200
assert client.get("/api/v1/operations/" + operation_id).status_code == 200
assert operation_id in [
op["operation_id"] for op in client.get("/api/v1/operations").json()
]