feat(server): add project RBAC and guarded workflows

This commit is contained in:
2026-07-30 16:45:09 +08:00
parent 3fbb17bb30
commit ae1a657554
29 changed files with 1431 additions and 412 deletions
+16 -2
View File
@@ -30,7 +30,7 @@ def test_agent_auth_context_returns_metadata_user_and_project_context():
project_id=project_id,
project_code="fengyang",
user_id=user_id,
project_role="editor",
project_role="member",
),
current_user=SimpleNamespace(
id=user_id,
@@ -52,7 +52,21 @@ def test_agent_auth_context_returns_metadata_user_and_project_context():
"is_superuser": False,
"project_id": str(project_id),
"network": "fengyang",
"project_role": "editor",
"project_role": "member",
"permissions": [
"burst.run",
"burst.view",
"optimization.run",
"optimization.view",
"risk.run",
"risk.view",
"scada.clean",
"scada.view",
"simulation.run",
"simulation.view",
"webgis.edit",
"webgis.view",
],
"token_expires_at": "2026-06-11T13:10:00+00:00",
}