后台挂起功能修改
This commit is contained in:
1 parent
cca954d01c
commit
f0c85c4795
8 files changed
+126
-13
No files matched your search
@@ -493,7 +493,11 @@ async def _enforce_agent_access(body: Any, request: Request) -> None:
|
||||
user_id = get_effective_user_id()
|
||||
# Admins see every agent in the admin console listing (?admin=true), so
|
||||
# they may also start a run against any of them.
|
||||
is_admin = getattr(getattr(request.state, "user", None), "system_role", None) == "admin"
|
||||
# ``request`` may be an in-process virtual request (SimpleNamespace) from
|
||||
# the roundtable job gateway / scheduled-task runtime — those carry no
|
||||
# ``state`` attribute, so the whole chain must be getattr-guarded
|
||||
# (a bare ``request.state`` raises AttributeError and kills the run).
|
||||
is_admin = getattr(getattr(getattr(request, "state", None), "user", None), "system_role", None) == "admin"
|
||||
for agent_id in agent_ids:
|
||||
try:
|
||||
normalized = validate_agent_id(agent_id)
|
||||
|
||||
Reference in new issue
Block a user