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 22c9473
Browse filesBrowse the repository at this point in the historyBrowse files
docs(spec): regenerate the security reference pages for the scoped check and priority texts
Output of pnpm --filter @objectstack/spec check:generated --fix, which
proved check:docs stale and regenerated only content/docs/references/**.
Claude-Session: https://claude.ai/code/session_01Sfe5YjBLwB9J3y8fvm2xq1
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: content/docs/references/security/permission.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,10 +168,10 @@ const result = AdminScopeSchema.parse(data);
168
168
|**object**|`string`| ✅ | Target object name |
169
169
|**operation**|`Enum<'select' \| 'insert' \| 'update' \| 'delete' \| 'all'>`| ✅ | Database operation this policy applies to |
170
170
|**using**|`string`| optional | Filter condition for SELECT/UPDATE/DELETE, authored in canonical CEL (ADR-0058 D1). It enforces when the predicate lowers to an ObjectQL filter: a field compared against a literal or a `current_user.*` context value using `==`, `!=`, `<`, `<=`, `>` or `>=`; `in` against a `current_user.*` array or an inline literal list (e.g. status in ['draft', 'pending']); these combined with `&&` / `\|\|`; or the bare allow-all `true`. Anything that does not lower fails closed — the policy matches zero rows. The legacy SQL-ish spellings are still accepted through a transitional bridge that rewrites `=` to `==` and `IN` to `in` (deprecated under ADR-0058 D1); SQL `AND` / `OR` / `NOT IN` / `IS NULL` / `LIKE` are NOT bridged and fail closed. Optional for INSERT-only policies. |
171
-
|**check**|`string`| optional | Validation condition for INSERT/UPDATE, matched against the new row (enforced at application level). The default to `using` is decided per operation across the applicable policies, not per policy: when any applicable policy for that operation declares `check`, only the declared checks decide (OR-combined) and a USING-only sibling adds nothing; only when none declares `check` does each applicable policy's `using` stand in as its check (OR-combined). Applicable = not `enabled: false`, `object` matches or is '*', `operation` matches or is 'all', and the caller holds one of its `positions` when it lists any. A `check` on a `select` or `delete` policy is never evaluated. |
171
+
|**check**|`string`| optional | Validation condition matched against the new row of a single-record INSERT or a by-id UPDATE (enforced at application level); an array insert and a `multi: true` update are not post-image checked. The default to `using` is decided per operation across the applicable policies, not per policy: when any applicable policy for that operation declares `check`, only the declared checks decide (OR-combined) and a USING-only sibling adds nothing; only when none declares `check` does each applicable policy's `using` stand in as its check (OR-combined). Applicable = not `enabled: false`, `object` matches or is '*', `operation` matches or is 'all', and the caller holds one of its `positions` when it lists any. A `check` on a `select` or `delete` policy is never evaluated. |
172
172
|**positions**|`string[]`| optional | Positions this policy applies to (omit for all) |
173
173
|**enabled**|`boolean`| optional (default: `true`) | Whether this policy is active |
174
-
|**priority**|`never`| optional |[REMOVED]`rowLevelSecurity[].priority` was removed in @objectstack/spec 17.0.0. It never had an effect and could not: applicable policies OR-combine (most permissive wins), so there is no conflict to order. Delete the key — policy outcomes are unchanged. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; apply them by hand. |
174
+
|**priority**|`never`| optional |[REMOVED]`rowLevelSecurity[].priority` was removed in @objectstack/spec 17.0.0. It never had an effect. Delete the key — policy outcomes are unchanged. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; apply them by hand. |
Copy file name to clipboardExpand all lines: content/docs/references/security/rls.mdx
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,7 +78,7 @@ Salesforce:
78
78
ObjectStack RLS:
79
79
- A constrained CEL predicate grammar: comparisons and set-membership against literals or `current_user.*` values, composable with `&&` / `||`; anything that does not lower to a filter fails closed
80
80
- Subquery-shaped needs are pre-resolved by the runtime (§7.3.1)
81
-
- Multiple policies OR-combine for union (any-match-allows) semantics
81
+
- Multiple policies OR-combine on reads (anymatchallows); for writes see `check`
82
82
83
83
### Best Practices
84
84
@@ -92,8 +92,7 @@ ObjectStack RLS:
92
92
93
93
1.**Defense in Depth**: RLS is one layer; use with object permissions
94
94
2.**Default Deny**: If no policy matches, access is denied
95
-
3.**Policy Precedence**: More permissive policy wins (OR logic)
96
-
4.**Context Variables**: Ensure current_user context is always set
95
+
3.**Context Variables**: Ensure current_user context is always set
97
96
98
97
See also: https://www.postgresql.org/docs/current/ddl-rowsecurity.html
99
98
@@ -172,10 +171,10 @@ const result = RLSEvaluationResultSchema.parse(data);
172
171
|**object**|`string`| ✅ | Target object name |
173
172
|**operation**|`Enum<'select' \| 'insert' \| 'update' \| 'delete' \| 'all'>`| ✅ | Database operation this policy applies to |
174
173
|**using**|`string`| optional | Filter condition for SELECT/UPDATE/DELETE, authored in canonical CEL (ADR-0058 D1). It enforces when the predicate lowers to an ObjectQL filter: a field compared against a literal or a `current_user.*` context value using `==`, `!=`, `<`, `<=`, `>` or `>=`; `in` against a `current_user.*` array or an inline literal list (e.g. status in ['draft', 'pending']); these combined with `&&` / `\|\|`; or the bare allow-all `true`. Anything that does not lower fails closed — the policy matches zero rows. The legacy SQL-ish spellings are still accepted through a transitional bridge that rewrites `=` to `==` and `IN` to `in` (deprecated under ADR-0058 D1); SQL `AND` / `OR` / `NOT IN` / `IS NULL` / `LIKE` are NOT bridged and fail closed. Optional for INSERT-only policies. |
175
-
|**check**|`string`| optional | Validation condition for INSERT/UPDATE, matched against the new row (enforced at application level). The default to `using` is decided per operation across the applicable policies, not per policy: when any applicable policy for that operation declares `check`, only the declared checks decide (OR-combined) and a USING-only sibling adds nothing; only when none declares `check` does each applicable policy's `using` stand in as its check (OR-combined). Applicable = not `enabled: false`, `object` matches or is '*', `operation` matches or is 'all', and the caller holds one of its `positions` when it lists any. A `check` on a `select` or `delete` policy is never evaluated. |
174
+
|**check**|`string`| optional | Validation condition matched against the new row of a single-record INSERT or a by-id UPDATE (enforced at application level); an array insert and a `multi: true` update are not post-image checked. The default to `using` is decided per operation across the applicable policies, not per policy: when any applicable policy for that operation declares `check`, only the declared checks decide (OR-combined) and a USING-only sibling adds nothing; only when none declares `check` does each applicable policy's `using` stand in as its check (OR-combined). Applicable = not `enabled: false`, `object` matches or is '*', `operation` matches or is 'all', and the caller holds one of its `positions` when it lists any. A `check` on a `select` or `delete` policy is never evaluated. |
176
175
|**positions**|`string[]`| optional | Positions this policy applies to (omit for all) |
177
176
|**enabled**|`boolean`| optional (default: `true`) | Whether this policy is active |
178
-
|**priority**|`never`| optional |[REMOVED]`rowLevelSecurity[].priority` was removed in @objectstack/spec 17.0.0. It never had an effect and could not: applicable policies OR-combine (most permissive wins), so there is no conflict to order. Delete the key — policy outcomes are unchanged. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; apply them by hand. |
177
+
|**priority**|`never`| optional |[REMOVED]`rowLevelSecurity[].priority` was removed in @objectstack/spec 17.0.0. It never had an effect. Delete the key — policy outcomes are unchanged. Run `os migrate meta --from 16` to list the mechanical edits for existing sources; apply them by hand. |
0 commit comments