Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/36285-relationships-predicate-floor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@objectstack/skills': patch
---

docs(skills): the data skill teaches that a predicate update or delete of a `controlled_by_parent` detail writes the rows its by-id writes do

Clause-②: no
Metadata-protocol: none

objectstack-data's `rules/relationships.md`, the `writeRequiresMasterRead: true` bullet under "Writes under `controlled_by_parent`": it no longer says the ownership floor (rows you created) binds a predicate update or delete. It now says a predicate (`multi: true`) update or delete writes the rows a by-id write of each would, all matched rows or none, which is what the runtime does since the change noted as "a predicate update or delete of a `controlled_by_parent` detail now writes every row its caller may write by id". The on-behalf-of half is unchanged: the floor still binds an on-behalf-of update or delete, for both users. `evals/objects-fields-relationships.json`, eval 17: its `expected_output` states the same rule; its assertions are unchanged.
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
{
"id": 17,
"prompt": "Order lines belong to orders. Anyone who can see an order should be able to add, change or remove its lines, as far as the line object's own permissions allow; nobody needs edit rights on the order itself for that. How do I declare the line's sharing?",
"expected_output": "`order_line` is `sharingModel: 'controlled_by_parent'` with a required `master_detail` field to `order`, plus `sharing: { controlledByParent: { writeRequiresMasterRead: true } }`: read access to the order becomes the master question for every write (insert, update, delete, re-point), and the line's own object permissions, RLS and FLS decide the rest. Without the key every line write needs edit on the order. Not `ownerMayEdit` (only the owner's by-id update, and refused beside the new key), not the key one level up (`sharing.writeRequiresMasterRead`, refused), and not on a non-`controlled_by_parent` object (refused). The platform ownership floor still binds predicate and on-behalf-of updates and deletes.",
"expected_output": "`order_line` is `sharingModel: 'controlled_by_parent'` with a required `master_detail` field to `order`, plus `sharing: { controlledByParent: { writeRequiresMasterRead: true } }`: read access to the order becomes the master question for every write (insert, update, delete, re-point), and the line's own object permissions, RLS and FLS decide the rest. Without the key every line write needs edit on the order. Not `ownerMayEdit` (only the owner's by-id update, and refused beside the new key), not the key one level up (`sharing.writeRequiresMasterRead`, refused), and not on a non-`controlled_by_parent` object (refused). A predicate (`multi: true`) update or delete writes the rows a by-id write of each would, all matched rows or none. The platform ownership floor still binds on-behalf-of updates and deletes, for both users.",
"files": [],
"assertions": {
"must_contain": [
Expand Down
9 changes: 5 additions & 4 deletions skills/objectstack-data/rules/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ sharing: { controlledByParent: { writeRequiresMasterRead: true } }, // or owner
other write, on-behalf-of included, still needs master edit.
- `writeRequiresMasterRead: true`: whoever reads the master inserts, updates and
deletes the detail under its own object permissions, RLS and FLS (re-points and
each opted-in chain hop too; on-behalf-of, both users must read the master). The
ownership floor (rows you created) still binds predicate and, for both users, on-behalf-of
updates and deletes. Refused beside `ownerMayEdit: true`, which it covers. Lint
`security-controlled-by-parent-owner-policy-without-opt-in` is silent here.
each opted-in chain hop too; on-behalf-of, both users must read the master). A
predicate (`multi: true`) update or delete writes the rows a by-id write of each would,
all matched rows or none. The ownership floor (rows you created) still binds, for both
users, on-behalf-of updates and deletes. Refused beside `ownerMayEdit: true`, which it
covers. Lint `security-controlled-by-parent-owner-policy-without-opt-in` is silent here.

The detail's own row policies AND in under both. Each is refused at parse under any
other `sharingModel` and one level up (`sharing.KEY`).
Expand Down
Loading