@live-change/access-control-service 0.9.15 → 0.9.16

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.
Files changed (2) hide show
  1. package/access.js +11 -1
  2. package/package.json +3 -3
package/access.js CHANGED
@@ -117,6 +117,8 @@ export default (definition) => {
117
117
  client, parentsSourcesMap, output
118
118
  }) {
119
119
  async function treeNode(objectType, object) {
120
+ if(!objectType) throw new Error('No objectType for accessControl treeNode')
121
+ if(!object) throw new Error('No object for accessControl treeNode')
120
122
  const node = {
121
123
  objectType, object,
122
124
  data: null,
@@ -202,6 +204,10 @@ export default (definition) => {
202
204
  }
203
205
 
204
206
  function accessPath(client, objects) {
207
+ for(const obj of objects) {
208
+ if(!obj.objectType) throw new Error('No objectType for accessControl accessPath')
209
+ if(!obj.object) throw new Error('No object for accessControl accessPath')
210
+ }
205
211
  return ['database', 'queryObject', app.databaseName, `(${
206
212
  async (input, output, {
207
213
  objects, parentsSourcesMap, client,
@@ -216,7 +222,7 @@ export default (definition) => {
216
222
  input, publicAccessTable, accessTable, updateRoles, isLoaded: () => loaded,
217
223
  client, parentsSourcesMap, output
218
224
  })
219
-
225
+
220
226
  let rolesTreesRoots = objects.map(({ object, objectType }) => treeNode(objectType, object, client))
221
227
 
222
228
  const outputObjectId = `${JSON.stringify(client.session)}:${JSON.stringify(client.user)}:` +
@@ -253,6 +259,10 @@ export default (definition) => {
253
259
  }
254
260
 
255
261
  function accessesPath(client, objects) {
262
+ for(const obj of objects) {
263
+ if(!obj.objectType) throw new Error('No objectType for accessControl accessesPath')
264
+ if(!obj.object) throw new Error('No object for accessControl accessesPath')
265
+ }
256
266
  return ['database', 'query', app.databaseName, `(${
257
267
  async (input, output, {
258
268
  objects, parentsSourcesMap, client,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/access-control-service",
3
- "version": "0.9.15",
3
+ "version": "0.9.16",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,8 +21,8 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.15"
24
+ "@live-change/framework": "^0.9.16"
25
25
  },
26
- "gitHead": "7b145114b9ca412b99f4c052d5069dd1729ff388",
26
+ "gitHead": "226df9fa7eb682f6d7da5e4541eb320e8309facf",
27
27
  "type": "module"
28
28
  }