feat: harden governed runs and add dashboard integration

This commit is contained in:
2026-07-29 14:16:28 +02:00
parent 8c2b6035cc
commit 09c98087c5
10 changed files with 372 additions and 29 deletions
+3 -1
View File
@@ -67,7 +67,7 @@ def normalize_definition_scope(
return principal.tenant_id, "group", clean_id
if clean_type == "user":
if not clean_id:
clean_id = principal.membership_id or principal.account_id
clean_id = principal.account_id
if (
clean_id not in {principal.membership_id, principal.account_id}
and not administrative
@@ -75,6 +75,8 @@ def normalize_definition_scope(
raise PermissionError(
"Definitions can only be created for the current user."
)
if clean_id == principal.membership_id:
clean_id = principal.account_id
return principal.tenant_id, "user", clean_id
raise ValueError(
"Definition scope must be system, tenant, group, or user."