free-be-account 0.0.5 → 0.0.7
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/index.js +1 -1
- package/package.json +1 -1
- package/routers/label/route.js +4 -4
- package/routers/mgmt/route.js +1 -1
package/index.js
CHANGED
|
@@ -541,7 +541,7 @@ module.exports = (app) => ({
|
|
|
541
541
|
*/
|
|
542
542
|
clearCachedPermission: (app, p = '*') => {
|
|
543
543
|
// clear all cached permission control (user permissions)
|
|
544
|
-
app.cache.keys(`perm_ctrl_${p}`).then(ks => {
|
|
544
|
+
Promise.resolve(app.cache.keys(`perm_ctrl_${p}`)).then(ks => {
|
|
545
545
|
ks.forEach(k => app.cache.del(k))
|
|
546
546
|
});
|
|
547
547
|
},
|
package/package.json
CHANGED
package/routers/label/route.js
CHANGED
|
@@ -29,13 +29,13 @@ router.get('/',
|
|
|
29
29
|
router.post('/',
|
|
30
30
|
(req, res, next) => {
|
|
31
31
|
if(req.body.Permission) {
|
|
32
|
-
if (!
|
|
32
|
+
if (!router.mdl.utils.clearPermission(req.body.Permission)) {
|
|
33
33
|
req.body.Permission = {};
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// permission changed, clear all cached account permission
|
|
37
37
|
// TODO: should be optimized??
|
|
38
|
-
|
|
38
|
+
router.mdl.clearCachedPermission(res.app);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// when create or update plabel, provided permission should NOT exceed the permission of the current user
|
|
@@ -55,13 +55,13 @@ router.post('/',
|
|
|
55
55
|
router.put('/',
|
|
56
56
|
(req, res, next) => {
|
|
57
57
|
if(req.body.Permission) {
|
|
58
|
-
if (!
|
|
58
|
+
if (!router.mdl.utils.clearPermission(req.body.Permission)) {
|
|
59
59
|
req.body.Permission = {};
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// permission changed, clear all cached account permission
|
|
63
63
|
// TODO: should be optimized??
|
|
64
|
-
|
|
64
|
+
router.mdl.clearCachedPermission(res.app);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
// when create or update plabel, provided permission should NOT exceed the permission of the current user
|
package/routers/mgmt/route.js
CHANGED