Skip to content

Commit d55c14e

Browse files
committed
docs(adr): ADR-0147 — membership-scoped RLS lowers to an engine-internal org-member semi-join leaf (Proposed)
Proposes that `FIELD in current_user.org_user_ids` keep its spelling and lower to a branded sibling of ReadableIds that the SQL family compiles to `IN (SELECT user_id FROM sys_member WHERE organization_id = :org ...)`, with the caller OR-ed in from the resolver's own (org, caller) anchor and the exact completion-read array as the floor for every evaluator that does not compile it. A same-set invariant (D-0) holds the visible set to exactly what the resolver answers today; options that change it are listed as rejected. ADR-0057-erp D3 gains an amendment note: the `org_user_ids` cap it cites no longer exists. Index regenerated. Claude-Session: https://claude.ai/code/session_01ADHkmSNasUm3e1dfbV5aaD Co-authored-by: Claude <noreply@anthropic.com>
1 parent cafe8ee commit d55c14e

3 files changed

Lines changed: 357 additions & 3 deletions

‎docs/adr/0057-erp-authorization-core-business-units-and-scope-depth.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ subordinate_user_ids -> users below me on the sys_user.manager_id chain (manag
160160
- Sourced by `BusinessUnitGraphService` (D2) and the existing `managerOf` chain
161161
(`packages/plugins/plugin-sharing/src/team-graph.ts#managerOf`). Bounded (hard cap + cache, mirroring the
162162
`org_user_ids` cap) and **org-scoped**.
163+
164+
> **Amendment note (2026-11-02, [ADR-0147](./0147-membership-scoped-rls-lowers-to-an-engine-internal-org-member-semi-join-leaf.md) — #29360).**
165+
> The precedent this bullet cites no longer exists as a cap. Since PR #29356 (`f72bc9e5`, #29281) `org_user_ids`
166+
> holds every member of the active organization plus the caller: the first `sys_member` read is completed by keyset
167+
> pages (`packages/core/src/security/resolve-authz-context.ts#readOrganizationMembersToCompletion`). What bounds it
168+
> now is the backend's bind-parameter ceiling, which ADR-0147 (Proposed) proposes to retire on the SQL family with an
169+
> engine-internal semi-join leaf. This D3's own requirement, that the rollup sets are bounded (hard cap + cache) and
170+
> org-scoped, is unchanged by this note. It stands on its own reason, not on the precedent.
163171
- Rollup is **additive only** (widens, never restricts) and respects tenant isolation. It powers both
164172
D1's `unit*` scopes and sharing-rule recipients (D6). Because it is pure pre-resolution, the choice
165173
of *which* tree drives visibility is an authoring/modelling decision, not a runtime-mechanism one.

0 commit comments

Comments
 (0)