Skip to content

Commit eb547b8

Browse files
committed
docs(skills): the data skill teaches that a predicate write of a controlled_by_parent detail matches its by-id writes
The writeRequiresMasterRead bullet in objectstack-data's rules/relationships.md and eval 17's expected_output said the ownership floor still binds a predicate update or delete. A non-delegated predicate (multi: true) update or delete now writes the rows a by-id write of each would, all matched rows or none; on-behalf-of keeps both users' floors. Claude-Session: https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY Co-authored-by: Claude <noreply@anthropic.com>
1 parent ed33f8a commit eb547b8

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
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
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
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.

‎skills/objectstack-data/evals/objects-fields-relationships.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
{
294294
"id": 17,
295295
"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?",
296-
"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.",
296+
"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.",
297297
"files": [],
298298
"assertions": {
299299
"must_contain": [

‎skills/objectstack-data/rules/relationships.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ sharing: { controlledByParent: { writeRequiresMasterRead: true } }, // or owner
8585
other write, on-behalf-of included, still needs master edit.
8686
- `writeRequiresMasterRead: true`: whoever reads the master inserts, updates and
8787
deletes the detail under its own object permissions, RLS and FLS (re-points and
88-
each opted-in chain hop too; on-behalf-of, both users must read the master). The
89-
ownership floor (rows you created) still binds predicate and, for both users, on-behalf-of
90-
updates and deletes. Refused beside `ownerMayEdit: true`, which it covers. Lint
91-
`security-controlled-by-parent-owner-policy-without-opt-in` is silent here.
88+
each opted-in chain hop too; on-behalf-of, both users must read the master). A
89+
predicate (`multi: true`) update or delete writes the rows a by-id write of each would,
90+
all matched rows or none. The ownership floor (rows you created) still binds, for both
91+
users, on-behalf-of updates and deletes. Refused beside `ownerMayEdit: true`, which it
92+
covers. Lint `security-controlled-by-parent-owner-policy-without-opt-in` is silent here.
9293

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

0 commit comments

Comments
 (0)