Skip to content

Commit e039b6a

Browse files
committed
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>
1 parent 799f77c commit e039b6a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎content/docs/permissions/rls.mdx‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export const ContributorAccess = definePermissionSet({
6060
| `object` | `string` | Target object — or `'*'` to apply to every object |
6161
| `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 |
6262
| `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) |
6464
| `positions` | `string[]` | Which positions the policy applies to. Omit = everyone |
6565
| `enabled` | `boolean` | Default `true`. `false` switches the policy off — a disabled policy is not evaluated |
6666

@@ -202,7 +202,10 @@ Four ways a policy denies rather than leaks:
202202
2. A referenced context variable is missing, null, or an empty array → that
203203
policy drops out (it cannot match).
204204
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.
206209

207210
<Callout type="warn">
208211
**The one non-obvious case: no applicable policy means *no restriction*, not

0 commit comments

Comments
 (0)