@live-change/relations-plugin 0.9.130 → 0.9.132

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.130",
3
+ "version": "0.9.132",
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.130",
25
+ "@live-change/framework": "^0.9.132",
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": "249279687126ae035353865197b6f3eff934794a"
33
+ "gitHead": "f9627117660732245586a784be1a21455c1c3bd2"
34
34
  }
package/src/propertyOf.ts CHANGED
@@ -34,6 +34,8 @@ export interface PropertyOfConfig extends RelationConfig {
34
34
  setOrUpdateAccess?: AccessSpecification
35
35
  resetAccess?: AccessSpecification
36
36
  readAllAccess?: AccessSpecification
37
+ singleAccess?: AccessSpecification
38
+ singleAccessControl?: AccessControlSettings
37
39
 
38
40
  readAccessControl?: AccessControlSettings
39
41
  writeAccessControl?: AccessControlSettings
@@ -70,7 +72,10 @@ export default function(service, app) {
70
72
  defineIndexes(context.model, context.otherPropertyNames, context.others)
71
73
 
72
74
  defineObjectView({ ...config }, context,
73
- !!(config.readAccess || config.writeAccess || config.readAccessControl || config.writeAccessControl))
75
+ !!(
76
+ config.singleAccess || config.singleAccessControl
77
+ || config.readAccess || config.readAccessControl
78
+ || config.writeAccess || config.writeAccessControl))
74
79
  defineRangeViews(config, context,
75
80
  !!(config.listAccess || config.readAccess || config.listAccessControl))
76
81
 
@@ -40,7 +40,7 @@ export function defineObjectView(config, context, external = true) {
40
40
  const viewName = config.name
41
41
  || ((config.prefix ? config.prefix + modelName : modelName[0].toLowerCase() + modelName.slice(1)) + (config.suffix || ''))
42
42
  model.crud.read = viewName
43
- const sourceAccessControl = external && (config.readAccessControl || config.writeAccessControl)
43
+ const sourceAccessControl = external && (config.singleAccessControl || config.readAccessControl || config.writeAccessControl)
44
44
  const accessControl = cloneAndPrepareAccessControl(sourceAccessControl,
45
45
  otherPropertyNames.concat(modelPropertyName),
46
46
  others.concat(model))
@@ -54,7 +54,7 @@ export function defineObjectView(config, context, external = true) {
54
54
  },
55
55
  internal: !external,
56
56
  global: config.globalView,
57
- access: external && (config.readAccess || config.writeAccess),
57
+ access: external && (config.singleAccess || config.readAccess || config.writeAccess),
58
58
  accessControl,
59
59
  daoPath(properties, { client, context }) {
60
60
  const idProp = modelPropertyName ? properties[modelPropertyName] : null