@steedos/standard-permission 2.3.0-beta.31 → 2.3.0-beta.33

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.
@@ -41,12 +41,16 @@ const initPermissionSet = async function(doc, userId, spaceId){
41
41
  throw new Error('权限集不能为空')
42
42
  }
43
43
 
44
- const permissionSet = await objectql.getObject('permission_set').findOne(doc.permission_set_id)
44
+ let permissionSet = null;
45
+ const permissionSets = await objectql.getObject('permission_set').find({filters: [['name', '=', doc.permission_set_id]]});
46
+
47
+ if(permissionSets && permissionSets.length > 0){
48
+ permissionSet = permissionSets[0];
49
+ }
45
50
 
46
51
  if(!permissionSet){
47
52
  throw new Error('无效的权限集')
48
53
  }
49
-
50
54
  if(permissionSet._id === permissionSet.name){
51
55
  const now = new Date();
52
56
  const dbPermissionSet = await objectql.getObject('permission_set').insert({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-permission",
3
- "version": "2.3.0-beta.31",
3
+ "version": "2.3.0-beta.33",
4
4
  "main": "package.service.js",
5
5
  "private": false,
6
6
  "publishConfig": {
@@ -12,5 +12,5 @@
12
12
  "description": "steedos package",
13
13
  "repository": {},
14
14
  "license": "MIT",
15
- "gitHead": "7cd0bd9b12852cf7e25e17a7d7345500401c3af5"
15
+ "gitHead": "a2570c1f4432d59f68d7c28b5147555367275108"
16
16
  }