You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 373edbc
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-automation): seed a runAs:'user' run's org_user_ids at run setup
A runAs:'user' flow's data context carried no org_user_ids, so the
shipped sys_user_org_members policy compiled unresolved-variable and
dropped out: the run saw only the acting user's own sys_user row while
the same user's request saw their organization's members.
Run setup now takes the peer list from the grants resolver the plugin
bridges to resolveUserAuthzGrants (the request path's resolver), also
when the trigger already carried positions/permissions (only the peer
list is taken then), and resolveRunDataContext passes it to every data
node. A context that already carries one keeps it.
Claude-Session: https://claude.ai/code/session_01LR1cD9JqgkeqY7k9rrZH8s
Co-authored-by: Claude <noreply@anthropic.com>
fix(service-automation): a `runAs: 'user'` flow now sees the acting user's organization members in `sys_user`, as the same user's own request does
6
+
7
+
A `runAs: 'user'` flow's data nodes ran without `current_user.org_user_ids`, the peer list the request path resolves for every user. The shipped `sys_user_org_members` policy (`id in current_user.org_user_ids`) therefore dropped out, and a `get_record` on `sys_user` returned the acting user's own row only, while the same user's REST read returned their organization's members too.
8
+
9
+
Run setup now seeds the peer list through the resolver the request path uses (`resolveUserAuthzGrants` from `@objectstack/core`), and every data node passes it on:
10
+
11
+
- It is the members of the run's organization (`tenantId`) plus the acting user. A run with no organization gets the acting user alone, which is what an organization-less request gets. A user who belongs only to other organizations is never in it, even one who shares another organization with the acting user.
12
+
- It is seeded for every trigger shape: the record-change shape (`userId` and `tenantId` only) and the REST and action doors' shape (positions and permission sets already resolved). For the second shape only the peer list is taken from the resolver; the forwarded positions and permission sets stay exactly as they were, so an agent's narrowed ceiling is not re-broadened.
13
+
- A `subflow` or `map` child and a resumed leg keep the list their run was seeded with.
14
+
- If the resolver fails, the run proceeds without the list, as before, and the `[runAs]` warning now says which half degraded. Policies that read `org_user_ids` then drop out: the run sees less, never more.
15
+
- A run suspended before this release resumes without the list and keeps today's answer (its own `sys_user` row) until it ends.
16
+
17
+
A `runAs: 'system'` flow is unchanged. The exported `RunIdentityContext` type gains an optional `org_user_ids` member.
0 commit comments