@live-change/access-control-service 0.8.53 → 0.8.55
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 +9 -4
- package/package.json +3 -3
package/access.js
CHANGED
|
@@ -54,8 +54,6 @@ export default (definition) => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
async function getUnitClientRoles(client, { objectType, object }, ignorePublic) {
|
|
57
|
-
const [ sessionOrUserType, sessionOrUser ] =
|
|
58
|
-
client.user ? ['user_User', client.user] : ['session_Session', client.session]
|
|
59
57
|
const [
|
|
60
58
|
publicAccessData,
|
|
61
59
|
sessionAccess,
|
|
@@ -74,6 +72,8 @@ export default (definition) => {
|
|
|
74
72
|
}
|
|
75
73
|
if(sessionAccess) roles.push(...sessionAccess.roles)
|
|
76
74
|
if(userAccess) roles.push(...userAccess.roles)
|
|
75
|
+
if(objectType === 'user_User' && object === client.user) roles.push('owner')
|
|
76
|
+
if(objectType === 'session_Session' && object === client.session) roles.push('owner')
|
|
77
77
|
//console.log("GOT UNIT CLIENT:", client, "ROLES:", roles, "IGNORE PUBLIC:", ignorePublic)
|
|
78
78
|
return Array.from(new Set(roles))
|
|
79
79
|
}
|
|
@@ -125,7 +125,8 @@ export default (definition) => {
|
|
|
125
125
|
publicSessionRoles: [],
|
|
126
126
|
publicUserRoles: [],
|
|
127
127
|
sessionRoles: [],
|
|
128
|
-
userRoles: []
|
|
128
|
+
userRoles: [],
|
|
129
|
+
ownerRoles: [],
|
|
129
130
|
}
|
|
130
131
|
let objectObserver, publicAccessObserver, sessionAccessObserver, userAccessObserver
|
|
131
132
|
|
|
@@ -152,6 +153,9 @@ export default (definition) => {
|
|
|
152
153
|
if(isLoaded()) updateRoles()
|
|
153
154
|
})
|
|
154
155
|
|
|
156
|
+
if(objectType === 'user_User' && object === client.user) node.ownerRoles.push('owner')
|
|
157
|
+
if(objectType === 'session_Session' && object === client.session) node.ownerRoles.push('owner')
|
|
158
|
+
|
|
155
159
|
async function disposeParents() {
|
|
156
160
|
const oldParents = node.parents
|
|
157
161
|
return Promise.all(oldParents.map(parent => parent.dispose()))
|
|
@@ -188,7 +192,8 @@ export default (definition) => {
|
|
|
188
192
|
...node.publicUserRoles,
|
|
189
193
|
...node.publicSessionRoles,
|
|
190
194
|
...node.userRoles,
|
|
191
|
-
...node.sessionRoles
|
|
195
|
+
...node.sessionRoles,
|
|
196
|
+
...node.ownerRoles,
|
|
192
197
|
]))
|
|
193
198
|
}
|
|
194
199
|
return { treeNode, computeNodeRoles }
|
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.55",
|
|
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.55"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "b2852afbfeceda54a0e3207ec92c9e86eaa0ebe2",
|
|
27
27
|
"type": "module"
|
|
28
28
|
}
|