@rebasepro/common 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -2047,7 +2047,7 @@ var buildPropertyCallbacks = (properties) => {
2047
2047
  * rows").
2048
2048
  *
2049
2049
  * **For auth collections additionally**
2050
- * 3. A permissive **self SELECT** grant (`id = auth.uid()`), so users can read
2050
+ * 3. A permissive **self SELECT** grant (`id = rebase.uid()`), so users can read
2051
2051
  * their own row (profile, session bootstrap) without every app re-declaring
2052
2052
  * it.
2053
2053
  * 4. A **restrictive** admin write gate. Restrictive policies are AND'd with
@@ -2056,7 +2056,7 @@ var buildPropertyCallbacks = (properties) => {
2056
2056
  * such as "a user may edit their own row". Without this, a permissive owner
2057
2057
  * rule would let a user change their own `roles`.
2058
2058
  *
2059
- * The server context is recognised as `auth.uid() IS NULL` (`policy.serverContext()`)
2059
+ * The server context is recognised as `rebase.uid() IS NULL` (`policy.serverContext()`)
2060
2060
  * — the built-in flows that run without a user (signup, migrations) set no user
2061
2061
  * GUC — which also lets the owner connection satisfy these policies even under
2062
2062
  * FORCE RLS. A *user* request never reaches that state: an anonymous one carries
@@ -2685,8 +2685,8 @@ function buildCollectionFromTableMetadata(tableName, metadata) {
2685
2685
  operations = ["delete"];
2686
2686
  break;
2687
2687
  }
2688
- const qual = policy.qual ?? void 0;
2689
- const withCheck = policy.with_check ?? void 0;
2688
+ const qual = policy.qual ? rewriteLegacyRlsFunctions(policy.qual) : void 0;
2689
+ const withCheck = policy.with_check ? rewriteLegacyRlsFunctions(policy.with_check) : void 0;
2690
2690
  if (qual) securityRules.push({
2691
2691
  name: policy.policy_name,
2692
2692
  operations,