Skip to content

armgit / AiSOC

Public Imported from GitHub
0

Open-source AI Security Operations Center: alert fusion, LLM-agent triage, MITRE ATT&CK investigation, and a replayable decision ledger for every agent step. Self-hostable, runs with no API keys, MIT licensed. Ships an MCP server for Claude, Cursor and Continue.

fix(api): resolve real permission set when dispatching approval decisions

Alexandru Mateescu019da181449c
diff --git a/services/api/app/api/v1/endpoints/approvals.py b/services/api/app/api/v1/endpoints/approvals.py
index 34c0d750c..efbf96ef3 100644
--- a/services/api/app/api/v1/endpoints/approvals.py
+++ b/services/api/app/api/v1/endpoints/approvals.py
@@ -40,6 +40,7 @@ from sqlalchemy import and_, func, select
from app.api.v1.deps import AuthUser, require_permission
from app.core.config import settings
+from app.core.security import ROLE_PERMISSIONS, has_permission
from app.db.rls import TenantDBSession
from app.models.responder import AgentApproval
from app.services.actions_client import ActionsServiceError, decide_action, submit_action
@@ -326,10 +327,9 @@ async def _dispatch_decision(
permissions = user.effective_permissions()
principal = {
"user_id": str(user.user_id),
+ "tenant_id": str(user.tenant_id),
"email": getattr(user, "email", None),
- # Singular on this class; sent as a list because that is the shape
- # `services/actions` reads.
- "roles": [user.role] if user.role else [],
+ "roles": [user.role] if getattr(user, "role", None) else [],
"permissions": permissions,
}