@steedos/service-cachers-manager 3.0.0-beta.69 → 3.0.0-beta.70
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/package.json +5 -5
- package/package.service.js +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-cachers-manager",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.70",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"build": "rm -rf ./lib && tsc"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@steedos/cachers": "3.0.0-beta.
|
|
12
|
-
"@steedos/metadata-registrar": "3.0.0-beta.
|
|
13
|
-
"@steedos/utils": "3.0.0-beta.
|
|
11
|
+
"@steedos/cachers": "3.0.0-beta.70",
|
|
12
|
+
"@steedos/metadata-registrar": "3.0.0-beta.70",
|
|
13
|
+
"@steedos/utils": "3.0.0-beta.70"
|
|
14
14
|
},
|
|
15
15
|
"publishConfig": {
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "597f124ef73efa97a2da52b4de3c7d733ebd6887"
|
|
19
19
|
}
|
package/package.service.js
CHANGED
|
@@ -15,6 +15,7 @@ const auth = require('@steedos/auth');
|
|
|
15
15
|
const { getObject } = require('@steedos/objectql');
|
|
16
16
|
const register = require('@steedos/metadata-registrar');
|
|
17
17
|
const _ = require('underscore');
|
|
18
|
+
const lodash = require('lodash');
|
|
18
19
|
/**
|
|
19
20
|
* @typedef {import('moleculer').Context} Context Moleculer's Context
|
|
20
21
|
* 软件包服务启动后也需要抛出事件。
|
|
@@ -217,6 +218,16 @@ module.exports = {
|
|
|
217
218
|
// 重新添加缓存
|
|
218
219
|
await this.loadProfiles();
|
|
219
220
|
}
|
|
221
|
+
if(isUpdate && isAfter && doc.type === 'permission_set'){
|
|
222
|
+
const noChanges = lodash.intersection(doc.users, previousDoc.users);
|
|
223
|
+
const mergedArray = lodash.concat(doc.users, previousDoc.users);
|
|
224
|
+
for (const userId of mergedArray) {
|
|
225
|
+
if(!lodash.includes(noChanges, userId)){
|
|
226
|
+
console.log('removeSpaceUserSessionFromCache', userId)
|
|
227
|
+
await auth.removeSpaceUserSessionFromCache(doc.space, userId);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
220
231
|
}
|
|
221
232
|
},
|
|
222
233
|
"$METADATA.profiles.*": {
|