@live-change/relations-plugin 0.9.164 → 0.9.165

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/relations-plugin",
3
- "version": "0.9.164",
3
+ "version": "0.9.165",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "type": "module",
24
24
  "dependencies": {
25
- "@live-change/framework": "^0.9.164",
25
+ "@live-change/framework": "^0.9.165",
26
26
  "pluralize": "^8.0.0"
27
27
  },
28
28
  "devDependencies": {
@@ -30,5 +30,5 @@
30
30
  "typedoc-plugin-markdown": "^4.6.3",
31
31
  "typedoc-plugin-rename-defaults": "^0.7.3"
32
32
  },
33
- "gitHead": "38f9fb8b01a9527d8f6036e174edd1fa41443301"
33
+ "gitHead": "687dab16bd0c6594544cdab70cd7eecc17bb510c"
34
34
  }
@@ -53,11 +53,11 @@ export interface EntityContext {
53
53
  }
54
54
 
55
55
 
56
- export function entityAccessControl({service, modelName, modelPropertyName}, accessControl) {
56
+ export function entityAccessControl({service, modelName, modelPropertyName}, accessControl, noObjects = false) {
57
57
  if(!accessControl) return undefined
58
58
  if(Array.isArray(accessControl)) accessControl = { roles: accessControl }
59
59
  return {
60
- objects: p => [{ objectType: service.name + '_' + modelName, object: p[modelPropertyName]}],
60
+ objects: noObjects ? undefined : p => [{ objectType: service.name + '_' + modelName, object: p[modelPropertyName]}],
61
61
  ...accessControl
62
62
  }
63
63
  }
@@ -191,7 +191,7 @@ export function defineCreateAction(config, context) {
191
191
  name: actionName,
192
192
  properties: { ...model.properties },
193
193
  access: config.createAccess || config.writeAccess,
194
- accessControl: entityAccessControl(context, config.createAccessControl || config.writeAccessControl),
194
+ accessControl: entityAccessControl(context, config.createAccessControl || config.writeAccessControl, true),
195
195
  skipValidation: true,
196
196
  //queuedBy: otherPropertyNames,
197
197
  waitForEvents: true,