@live-change/access-control-service 0.9.164 → 0.9.166
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 +2 -1
- package/accessControl.js +2 -2
- package/package.json +3 -3
package/access.js
CHANGED
|
@@ -237,10 +237,11 @@ export default (definition) => {
|
|
|
237
237
|
const accessesRoles = roots.map(root => computeNodeRoles(root))
|
|
238
238
|
//output.debug(outputObjectId, "Accesses roles:", accessesRoles)
|
|
239
239
|
const firstAccessRoles = accessesRoles.shift()
|
|
240
|
-
let roles = firstAccessRoles
|
|
240
|
+
let roles = firstAccessRoles ?? []
|
|
241
241
|
for(const accessRoles of accessesRoles) {
|
|
242
242
|
roles = roles.filter(role => accessRoles.includes(role))
|
|
243
243
|
}
|
|
244
|
+
output.debug('accessRoles', JSON.stringify(roles, null, 2))
|
|
244
245
|
const outputObject = {
|
|
245
246
|
id: outputObjectId,
|
|
246
247
|
roles: Array.from(new Set([...roles, ...client.roles]))
|
package/accessControl.js
CHANGED
|
@@ -30,7 +30,7 @@ definition.processor({
|
|
|
30
30
|
)
|
|
31
31
|
|
|
32
32
|
if(objects.length === 0) {
|
|
33
|
-
|
|
33
|
+
console.warn('no objects for ' + service.name + ' action ' + action.name + ' access control to work - only global roles will be checked')
|
|
34
34
|
}
|
|
35
35
|
const accessible = await access.clientHasAccessRoles(client, { objects }, config.roles)
|
|
36
36
|
|
|
@@ -79,7 +79,7 @@ definition.processor({
|
|
|
79
79
|
((objectType && object) ? [{ objectType, object }] : [])
|
|
80
80
|
)
|
|
81
81
|
if(objects.length === 0) {
|
|
82
|
-
|
|
82
|
+
console.warn('no objects for ' + service.name + ' view ' + viewName + ' access control to work - only global roles will be checked')
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const rolesPath = access.accessPath(client, objects)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/access-control-service",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.166",
|
|
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.
|
|
24
|
+
"@live-change/framework": "^0.9.166"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "e99ff5ce503d5dc894d0cfe954a58397683d12e0",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|