You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e039b6a
Browse filesBrowse the repository at this point in the historyBrowse files
docs(permissions): the RLS page states the per-operation check default
The property table and the fail-closed list said an omitted check reuses
using. That holds only when no applicable policy for the operation declares
a check; when one does, only the declared checks decide.
Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1
Co-authored-by: Claude <noreply@anthropic.com>
|`object`|`string`| Target object — or `'*'` to apply to every object |
61
61
|`operation`|`'select' \| 'insert' \| 'update' \| 'delete' \| 'all'`| Which operation the policy guards. A `select` policy also bounds writes when no write-class policy applies — see below |
62
62
|`using`|`string`| Predicate for rows the user may **see / act on** (compiled into the query filter) |
63
-
|`check`|`string`| Predicate rows must satisfy **after a write**. Omit it and `using`is reused|
63
+
|`check`|`string`| Predicate the new row must satisfy **after an insert or update**. Omit it and `using`stands in, unless another applicable policy for the same operation declares a `check` — see [the fail-closed contract](#the-fail-closed-contract)|
64
64
|`positions`|`string[]`| Which positions the policy applies to. Omit = everyone |
65
65
|`enabled`|`boolean`| Default `true`. `false` switches the policy off — a disabled policy is not evaluated |
66
66
@@ -202,7 +202,10 @@ Four ways a policy denies rather than leaks:
202
202
2. A referenced context variable is missing, null, or an empty array → that
203
203
policy drops out (it cannot match).
204
204
3. A policy references a column the object doesn't have → deny.
205
-
4.`check` is omitted → `using` is reused for writes, never "anything goes".
205
+
4.`check` is omitted → `using` stands in as the write check. The choice is
206
+
made per operation across all the applicable policies, not policy by
207
+
policy: when any of them declares a `check`, only the declared checks
208
+
decide, and a USING-only sibling's `using` is not part of the write check.
206
209
207
210
<Callouttype="warn">
208
211
**The one non-obvious case: no applicable policy means *no restriction*, not
0 commit comments