@stoker-platform/node-client 0.5.90 → 0.5.91

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/bundle.js CHANGED
@@ -281,10 +281,15 @@ const Kn = (t) => !!t && !Array.isArray(t), ln = (t, e) => t.access ? Kn(t.acces
281
281
  }, aa = (t, e, n) => {
282
282
  let s = !0, r = "";
283
283
  Object.values(t.collections).filter((i) => i.auth).forEach((i) => {
284
- if (e.collections?.[i.labels.collection]?.auth && !i.access.auth?.includes(e.Role)) {
284
+ const o = e.collections?.[i.labels.collection], a = i.access.auth, l = e.Role;
285
+ if (o?.auth && !a?.roles.includes(l)) {
285
286
  r = "Record cannot have auth access to collection", s = !1;
286
287
  return;
287
288
  }
289
+ if (a?.roles.includes(l) && !a.assignable?.includes(l) && !o?.auth) {
290
+ r = "Record is missing required auth access to collection", s = !1;
291
+ return;
292
+ }
288
293
  });
289
294
  for (const i of Object.values(t.collections)) {
290
295
  const { labels: o, access: a, fields: l } = i, { operations: c, attributeRestrictions: d, entityRestrictions: h } = a, u = c.assignable, f = e.collections?.[o.collection], g = ["read", "create", "update", "delete"];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stoker-platform/node-client",
3
- "version": "0.5.90",
3
+ "version": "0.5.91",
4
4
  "type": "module",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "files": [
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@google-cloud/storage": "^7.19.0",
27
- "@stoker-platform/types": "0.5.65",
28
- "@stoker-platform/utils": "0.5.79",
27
+ "@stoker-platform/types": "0.5.66",
28
+ "@stoker-platform/utils": "0.5.80",
29
29
  "@types/luxon": "^3.7.1",
30
30
  "cross-spawn": "^7.0.6",
31
31
  "firebase-admin": "^13.10.0",