free-be-account 0.0.5 → 0.0.6

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-be-account",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -29,13 +29,13 @@ router.get('/',
29
29
  router.post('/',
30
30
  (req, res, next) => {
31
31
  if(req.body.Permission) {
32
- if (!res.app.modules['passport'].utils.clearPermission(req.body.Permission)) {
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
- res.app.modules['passport'].clearCachedPermission(res.app);
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 (!res.app.modules['passport'].utils.clearPermission(req.body.Permission)) {
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
- res.app.modules['passport'].clearCachedPermission(res.app);
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
@@ -294,7 +294,7 @@ router.post('/:id/resetpwd',
294
294
 
295
295
  router.delete('/', router.DeleteDocument('account'));
296
296
 
297
- router.get(`/org/search`,
297
+ router.get(`/search`,
298
298
  async (req, res, next) => {
299
299
  res.locals = res.locals || {};
300
300