@live-change/access-control-service 0.8.34 → 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 +4 -3
- package/accessControl.js +1 -0
- package/package.json +3 -3
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
|
|
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
|
|
|
@@ -298,8 +299,8 @@ export default (definition) => {
|
|
|
298
299
|
}
|
|
299
300
|
|
|
300
301
|
function accessLimitedObservable(client, objects, path) {
|
|
301
|
-
if(path[0]
|
|
302
|
-
const isObject = 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/access-control-service",
|
|
3
|
-
"version": "0.8.
|
|
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.
|
|
24
|
+
"@live-change/framework": "^0.8.35"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "90fbb746dc7270895daf17b437ca48c0b0a01c01",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|