@live-change/access-control-service 0.8.33 → 0.8.35

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/access.js CHANGED
@@ -17,7 +17,7 @@ export default (definition) => {
17
17
  } = config
18
18
 
19
19
  function testRoles(requiredRoles, clientRoles) {
20
- if(!requiredRoles || requiredRoles.length == 0) return true
20
+ if(!requiredRoles || requiredRoles.length === 0) return true
21
21
  for(const requiredRolesOption of requiredRoles) {
22
22
  if(
23
23
  (Array.isArray(requiredRolesOption) ? requiredRolesOption : [requiredRolesOption])
@@ -104,6 +104,7 @@ export default (definition) => {
104
104
  async function checkRoles(client, { objectType, object, objects }, callback, ignorePublic) {
105
105
  const allObjects = ((objectType && object) ? [{ objectType, object }] : []).concat(objects || [])
106
106
  const roles = await getClientObjectsRoles(client, allObjects, ignorePublic)
107
+ console.log('checkRoles', allObjects, roles)
107
108
  return await callback(roles, client, { objectType, object })
108
109
  }
109
110
 
@@ -267,9 +268,9 @@ export default (definition) => {
267
268
  id: outputObjectId,
268
269
  roles: Array.from(new Set([...nodeRoles, ...client.roles]))
269
270
  }
270
- const existingAccessIndex = accesses.findIndex(acc => acc.id == outputObjectId)
271
- if(existingAccessIndex != -1) {
272
- if(JSON.stringify(outputObject) != JSON.stringify(accesses[existingAccessIndex])) {
271
+ const existingAccessIndex = accesses.findIndex(acc => acc.id === outputObjectId)
272
+ if(existingAccessIndex !== -1) {
273
+ if(JSON.stringify(outputObject) !== JSON.stringify(accesses[existingAccessIndex])) {
273
274
  output.change(outputObject, accesses[existingAccessIndex])
274
275
  accesses[existingAccessIndex] = outputObject
275
276
  } /// else ignore
@@ -298,8 +299,8 @@ export default (definition) => {
298
299
  }
299
300
 
300
301
  function accessLimitedObservable(client, objects, path) {
301
- if(path[0] != 'database') throw new Error("non database path "+ JSON.stringify(path))
302
- const isObject = path[1] == 'queryObject' || path[1] == ''
302
+ if(path[0] !== 'database') throw new Error("non database path "+ JSON.stringify(path))
303
+ const isObject = path[1] === 'queryObject' || path[1] === ''
303
304
  }
304
305
 
305
306
  return {
package/accessControl.js CHANGED
@@ -14,6 +14,7 @@ definition.processor({
14
14
  const action = service.actions[actionName]
15
15
  if(!action.accessControl) continue
16
16
  const config = action.accessControl
17
+ if(config.public) continue
17
18
 
18
19
  console.log("ACCESS CONTROL", service.name, "ACTION", action.name)
19
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/access-control-service",
3
- "version": "0.8.33",
3
+ "version": "0.8.35",
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.8.33"
24
+ "@live-change/framework": "^0.8.35"
25
25
  },
26
- "gitHead": "98ff6f9c09e5fc1f408010df6cc8038eff571276",
26
+ "gitHead": "90fbb746dc7270895daf17b437ca48c0b0a01c01",
27
27
  "type": "module"
28
28
  }