Skip to content

Commit 185f9d4

Browse files
committed
chore(changeset): declare the plugin-sharing write-gate narrowing for the two predicate shapes
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jVPGBoi3MCGoKbW1Hv
1 parent 5b5c685 commit 185f9d4

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

‎.changeset/33928-operator-id-write-gate.md‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,26 @@
22
'@objectstack/plugin-sharing': patch
33
---
44

5-
fix(plugin-sharing): the write gate judges by id exactly the writes the engine runs by id
5+
fix(plugin-sharing)!: the write gate judges by id exactly the writes the engine runs by id
66

7-
Clause-②: yes (widening): a request refused today lands when every matched row is admitted; measured again by the dev before the PR
7+
Clause-②: no (narrowing)
88
Metadata-protocol: none
9+
Skills-docs: none — the docs already state the rule this gate now follows for every predicate write: a predicate (`multi: true`) update or delete writes only the rows the caller may write (`content/docs/permissions/permissions-matrix.mdx`, `content/docs/permissions/rls.mdx`), and no skill teaches either shape named below.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) a runtime authorization answer moves: no metadata key, accepted value or stored row changes, so `os migrate meta` has nothing to rewrite -->
912

1013
The sharing write gate now takes its by-id or bulk branch from the engine's own dispatch decision for the write's options. A write the engine runs by id is judged by id, as before. Every other write is one the engine runs as a predicate, an `$in` or `$eq` on `id` included, and it meets the bulk write scope: it writes the rows the caller may update or delete, leaves the others as they were, and answers no error.
1114

1215
A member's multi-row delete or update of rows it owns, on a `private` or `public_read` object with an `owner_id`, now lands where it answered 403 FORBIDDEN.
16+
17+
**BREAKING** for a caller of a multi-row (`multi: true`) update or delete in one of two shapes, both of which the engine runs as a predicate and the gate now judges as one:
18+
19+
- a `where` that carries a scalar `id` beside another key;
20+
- an `id` that is falsy (`''` or `0`).
21+
22+
Such a write meets the bulk write scope instead of the by-id judgment:
23+
24+
- a row the caller may not write is left as it was, and the write answers no error where it answered 403 FORBIDDEN;
25+
- a row the caller may write only because an application row-level policy widens the sharing scope for it (the by-id judgment's deferral to such a policy) is no longer written by these two shapes, as for every other predicate write.
26+
27+
To write such a row, address it by id alone (`where: { id }`, or the payload `id`): that write is judged by id, as before.

0 commit comments

Comments
 (0)