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 bdc8e70
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service-automation): stamp org/owner/creator on runAs:'system' create_record per ADR-0118 (#5494) (#6153)
resolveRunDataContext's system branch discarded the trigger's userId/
tenantId, and every platform stamp for the three columns keys on exactly
what was discarded: created_by on the write context's userId (ObjectQL
audit hook), owner_id on the acting user in the security middleware
(whole chain short-circuits on isSystem), organization_id on the context
tenantId (driver-level tenant machinery). Rows a user-triggered system
sweep created were born with all three NULL - outside the org partition
and untouchable even by the triggering member (#5494's admin-403).
Fix, at the writer's seam (runAs is authorization posture, not identity,
ADR-0073 D2; elevation is not anonymity, #3783):
- the system branch now carries the trigger's userId + tenantId through,
the same { ...caller, isSystem: true } envelope the action-body seam
ships (the hotcrm#548-family fix): created_by/updated_by stamp again,
audit rows credit the human, the driver fills organization_id on born
rows, and record-change cascades keep the triggering identity;
- create_record fills owner_id (fill-only, schema-guarded) for system
runs with a known acting user - the anchor's platform stamp is behind
the isSystem short-circuit, so the payload is the only channel; the
value is the acting user, never a system identity (ADR-0118 D6,
ADR-0073 D3), and flow-authored fields always win;
- genuinely user-less runs (schedules) stamp nothing: no acting user
exists, and ADR-0118 D1 bans sentinel/pseudo-user stand-ins; the
svc:flow actor label + flowRunId remain the provenance channels.
Acceptance replays the issue's step-3->5 flip against the real
SecurityPlugin: the same member context is denied on the NULL-born row
and admitted on the stamped row - row content, not caller, decides.
Fixes#5494
Claude-Session: https://claude.ai/code/session_015a5qkLzpGXhLL2F5gvJ7dD
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments