Repository navigation
Commit 6171331
A `controlled_by_parent` detail whose master is ITSELF `controlled_by_parent`
was readable and writable org-wide. #5386 made the derivation fold in the
master's ownership and share grants, but it does not recurse, and both halves
it composes answer "no restriction" for a derived master: the RLS half is null
(a derived object authors no policy) and the sharing half is null too
(`buildReadFilter` opts out of every non-`private` model, and
`effectiveSharingModel` maps `controlled_by_parent` to `public`). Composed
null, the master query ran as system with an empty predicate and returned
every master row.
The write half failed through a SEPARATE mechanism: the master gate asks
`canEdit` on the master row, `checkEdit` returns `abstain` for a
`public`-mapped model, and `abstain` is not `deny`.
Read side: the master's own derivation is now AND-composed as a third layer.
Write side: the three master-edit legs are extracted verbatim and run on each
hop until a master that governs its own rows is reached; every added refusal
keeps #7474's `403 PERMISSION_DENIED` envelope, named for the caller's own
object and operation.
Not a blanket deny: a detail whose whole chain is reachable stays reachable,
and the single-level case is byte-for-byte unchanged. Cycle protection and a
depth bound of 8 both fail CLOSED, never to "no restriction".
Claude-Session: https://claude.ai/code/session_01PnJHU45vPJj5UQrxe946Bx
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1ddda1d commit 6171331
3 files changed
Lines changed: 928 additions & 6 deletions
File tree
- .changeset
- packages/plugins/plugin-security/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
0 commit comments