@live-change/access-control-service 0.8.58 → 0.8.59
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 +8 -3
- package/package.json +3 -3
package/access.js
CHANGED
|
@@ -164,13 +164,16 @@ export default (definition) => {
|
|
|
164
164
|
if(parentsSources) {
|
|
165
165
|
const objectTable = input.table(objectType)
|
|
166
166
|
const objectTableObject = objectTable.object(object)
|
|
167
|
+
let obsv = false
|
|
167
168
|
objectObserver = objectTableObject.onChange(async (objectData, oldObjectData) => {
|
|
168
169
|
await disposeParents()
|
|
169
170
|
node.parents = objectData ? await Promise.all(parentsSources.map(parentSource => {
|
|
170
171
|
const parentType = parentSource.type || objectData[parentSource.property + 'Type']
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
172
|
+
const property = objectData[parentSource.property]
|
|
173
|
+
const parents = Array.isArray(property) ? property : [ property ]
|
|
174
|
+
return parents.map(parent => treeNode(parentType, parent))
|
|
175
|
+
}).flat()) : []
|
|
176
|
+
obsv = true
|
|
174
177
|
})
|
|
175
178
|
}
|
|
176
179
|
node.dispose = async function() {
|
|
@@ -222,6 +225,7 @@ export default (definition) => {
|
|
|
222
225
|
.join(':')
|
|
223
226
|
let oldOutputObject = null
|
|
224
227
|
async function updateRoles() {
|
|
228
|
+
if(!loaded) return
|
|
225
229
|
const roots = await Promise.all(rolesTreesRoots)
|
|
226
230
|
const accessesRoles = roots.map(root => computeNodeRoles(root))
|
|
227
231
|
output.debug(outputObjectId, "Accesses roles:", accessesRoles)
|
|
@@ -267,6 +271,7 @@ export default (definition) => {
|
|
|
267
271
|
let rolesTreesRoots = objects.map(({ object, objectType }) => treeNode(objectType, object, client))
|
|
268
272
|
const accesses = []
|
|
269
273
|
async function updateRoles() {
|
|
274
|
+
if(!loaded) return
|
|
270
275
|
const roots = await Promise.all(rolesTreesRoots)
|
|
271
276
|
for(let root of roots) {
|
|
272
277
|
const outputObjectId = `${JSON.stringify(client.session)}:${JSON.stringify(client.user)}` +
|
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.59",
|
|
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.59"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "69e6b3004d32994e5fd64df03bf025e04073df3f",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|