@live-change/access-control-service 0.8.52 → 0.8.53
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 +3 -1
- package/accessControl.js +3 -3
- package/package.json +3 -3
package/access.js
CHANGED
|
@@ -74,6 +74,7 @@ export default (definition) => {
|
|
|
74
74
|
}
|
|
75
75
|
if(sessionAccess) roles.push(...sessionAccess.roles)
|
|
76
76
|
if(userAccess) roles.push(...userAccess.roles)
|
|
77
|
+
//console.log("GOT UNIT CLIENT:", client, "ROLES:", roles, "IGNORE PUBLIC:", ignorePublic)
|
|
77
78
|
return Array.from(new Set(roles))
|
|
78
79
|
}
|
|
79
80
|
|
|
@@ -105,7 +106,8 @@ export default (definition) => {
|
|
|
105
106
|
async function checkRoles(client, { objectType, object, objects }, callback, ignorePublic) {
|
|
106
107
|
const allObjects = ((objectType && object) ? [{ objectType, object }] : []).concat(objects || [])
|
|
107
108
|
const roles = await getClientObjectsRoles(client, allObjects, ignorePublic)
|
|
108
|
-
console.log('checkRoles', allObjects, roles)
|
|
109
|
+
//console.log('checkRoles', allObjects, roles)
|
|
110
|
+
//console.trace("CHECK ROLES!")
|
|
109
111
|
return await callback(roles, client, { objectType, object })
|
|
110
112
|
}
|
|
111
113
|
|
package/accessControl.js
CHANGED
|
@@ -43,7 +43,7 @@ definition.processor({
|
|
|
43
43
|
if(!view.accessControl) continue
|
|
44
44
|
const config = view.accessControl
|
|
45
45
|
|
|
46
|
-
console.log("ACCESS CONTROL", service.name, "VIEW", view.name)
|
|
46
|
+
//console.log("ACCESS CONTROL", service.name, "VIEW", view.name, "CONFIG", config)
|
|
47
47
|
|
|
48
48
|
const oldGet = view.get
|
|
49
49
|
const oldObservable = view.observable
|
|
@@ -58,8 +58,8 @@ definition.processor({
|
|
|
58
58
|
if(objects.length === 0) {
|
|
59
59
|
throw new Error('no objects for access control to work in view ' + viewName)
|
|
60
60
|
}
|
|
61
|
-
console.log("OBJECTS", objects)
|
|
62
|
-
|
|
61
|
+
/*console.log("OBJECTS", objects)
|
|
62
|
+
console.log("CLIENT", client)
|
|
63
63
|
console.log("ROLES", config.roles)*/
|
|
64
64
|
const accessible = await access.clientHasAccessRoles(client, { objects }, config.roles)
|
|
65
65
|
if(!accessible) throw 'notAuthorized'
|
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.53",
|
|
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.53"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "39422adadd1863fa396fc4e875936e09428d6cf1",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|