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
fix(plugin-approvals): screen the team approver expansion to the request's organization (#10546)
* fix(plugin-approvals): screen the `team` approver expansion to the request's organization
`team` was the last approver expansion that resolved people without asking
which organization was asking. A request in org_a routed to a team stamped
`organization_id: org_b` placed that team's members into pending_approvers,
handing approval authority over the record outside its tenant.
Screen the TEAM rather than its members: `sys_team` carries `organization_id`
outright, so a team id transitively names exactly one organization and one row
answers the question — unlike `sys_user` (#10153's `manager` screen), which
carries no tenancy fact and must be placed via `sys_member`.
The screen is fail-open on an ABSENT tenancy fact (null org stamp, missing row,
unreadable table, request with no organization) and fail-closed only on a
present and negative one, matching `managerIsProvablyOutsideOrg` and
`businessUnitOrgScope`.
Both call sites are threaded: the static `team` branch screens against the
request's own organization, and the `expression` / `resolveAs: 'team'` branch
against `directoryOrg` — `expression` IS org-scoped, so a declaration there
retargets a sibling organization legitimately.
Fixes#10230
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx
* chore(gates): record the new team-approver engine double in the pinned ledger
`check:engine-double-contract` retained the new test file's delete/update
doubles as unrecorded coverage. Regenerated with --write: 2 rows added, 0 lost.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments