@steedos/standard-permission 2.3.6 → 2.3.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.
@@ -1,5 +1,5 @@
1
1
  name: permission_set
2
- label: Profile & Permission Set
2
+ label: Permission Set
3
3
  description:
4
4
  fields:
5
5
  name:
@@ -1,5 +1,5 @@
1
1
  name: permission_set
2
- label: 简档 & 权限集
2
+ label: 权限集
3
3
  description:
4
4
  fields:
5
5
  name:
@@ -43,6 +43,24 @@ fields:
43
43
  required: true
44
44
  create: false
45
45
  sort_no: 130
46
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
47
+ function () {
48
+ var _options;
49
+
50
+ _options = [];
51
+
52
+ _.forEach(Creator.objectsByName, function (o, k) {
53
+ if (!o.hidden) {
54
+ return _options.push({
55
+ label: o.label,
56
+ value: k,
57
+ icon: o.icon
58
+ });
59
+ }
60
+ });
61
+
62
+ return _options;
63
+ }
46
64
  name: object_name
47
65
  filterable: true
48
66
  field:
@@ -11,13 +11,13 @@ module.exports = {
11
11
  delete newDoc.is_system;
12
12
 
13
13
  let permissionSetId = doc.permission_set_id
14
- if(_.includes(['admin','user','supplier','customer'], doc.permission_set_id)){
14
+ if(_.include(['admin','user','supplier','customer'], doc.permission_set_id)){
15
15
  let dbPst = Creator.odata.query('permission_set', {$select: "_id", $filter: "(name eq '"+doc.permission_set_id+"') and (space eq '"+Steedos.getSpaceId()+"')"}, true)
16
16
  if(dbPst && dbPst.length > 0){
17
17
  permissionSetId = dbPst[0]._id;
18
18
  }
19
19
 
20
- if(_.includes(['admin','user','supplier','customer'], permissionSetId)){
20
+ if(_.include(['admin','user','supplier','customer'], permissionSetId)){
21
21
  return toastr.error("请先自定义权限集")
22
22
  }
23
23
  }
@@ -32,8 +32,7 @@ module.exports = {
32
32
  }
33
33
  });
34
34
  },
35
- customizeVisible: function(object_name, record_id, record_permissions, data){
36
- var record = data && data.record;
35
+ customizeVisible: function(object_name, record_id, record_permissions, record){
37
36
  if(!record){
38
37
  record = {}
39
38
  }
@@ -49,12 +48,10 @@ module.exports = {
49
48
  FlowRouter.reload();
50
49
  }
51
50
  },
52
- resetFieldPermissionsVisible: function (object_name, record_id, record_permissions, data) {
53
- var record = data && data.record;
51
+ resetFieldPermissionsVisible: function (object_name, record_id, record_permissions, record) {
54
52
  if (!record) {
55
53
  record = {}
56
54
  }
57
- return Creator.baseObject.actions.standard_new.visible() && !record.is_system;
58
- // return !(Creator.baseObject.actions.standard_new.visible() && record.is_system);
55
+ return !(Creator.baseObject.actions.standard_new.visible() && record.is_system);
59
56
  }
60
57
  }
@@ -29,6 +29,24 @@ fields:
29
29
  index: true
30
30
  required: true
31
31
  create: false
32
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
33
+ function () {
34
+ var _options;
35
+
36
+ _options = [];
37
+
38
+ _.forEach(Creator.objectsByName, function (o, k) {
39
+ if (!o.hidden) {
40
+ return _options.push({
41
+ label: o.label,
42
+ value: k,
43
+ icon: o.icon
44
+ });
45
+ }
46
+ });
47
+
48
+ return _options;
49
+ }
32
50
  name: object_name
33
51
  filterable: true
34
52
  allowRead:
@@ -8,8 +8,7 @@ module.exports = {
8
8
  });
9
9
 
10
10
  },
11
- customizeVisible: function(object_name, record_id, record_permissions, data){
12
- var record = data && data.record;
11
+ customizeVisible: function(object_name, record_id, record_permissions, record){
13
12
  if(!record){
14
13
  record = {}
15
14
  }
@@ -1,5 +1,5 @@
1
1
  name: permission_set
2
- label: Profile & Permission Set
2
+ label: Permission Set
3
3
  icon: groups
4
4
  hidden: false
5
5
  enable_inline_edit: false
@@ -39,8 +39,22 @@ fields:
39
39
  label: Assigned Apps
40
40
  type: lookup
41
41
  multiple: true
42
- reference_to: apps
43
- reference_to_field: code
42
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
43
+ function () {
44
+ var _options;
45
+
46
+ _options = [];
47
+
48
+ _.forEach(Creator.Apps, function (o, k) {
49
+ return _options.push({
50
+ label: o.label || o.name,
51
+ value: k,
52
+ icon: o.icon_slds
53
+ });
54
+ });
55
+
56
+ return _options;
57
+ }
44
58
  name: assigned_apps
45
59
  filterable: true
46
60
  users:
@@ -13,9 +13,12 @@ fields:
13
13
  label: Object
14
14
  type: lookup
15
15
  multiple: true
16
- reference_to: objects
17
- reference_to_field: name
18
- filters: ["enable_share", "=", true]
16
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
17
+ function () {
18
+ return Steedos.getObjectsOptions(function(o){
19
+ return o.enable_share
20
+ })
21
+ }
19
22
  required: true
20
23
  filterable: true
21
24
  filters:
@@ -24,8 +24,7 @@ module.exports = {
24
24
  }
25
25
  });
26
26
  },
27
- customizeVisible: function (object_name, record_id, record_permissions, data) {
28
- var record = data && data.record;
27
+ customizeVisible: function (object_name, record_id, record_permissions, record) {
29
28
  return record && Creator.baseObject.actions.standard_new.visible() && record.is_system;
30
29
  }
31
30
  }
@@ -16,8 +16,7 @@ module.exports = {
16
16
  }
17
17
  });
18
18
  },
19
- customizeVisible: function (object_name, record_id, record_permissions, data) {
20
- var record = data && data.record;
19
+ customizeVisible: function (object_name, record_id, record_permissions, record) {
21
20
  if (!record) {
22
21
  record = {}
23
22
  }
@@ -15,6 +15,10 @@ fields:
15
15
  write_requires_master_read: true
16
16
  reference_to_field: name
17
17
  required: true
18
+ optionsFunction: !<tag:yaml.org,2002:js/function> |-
19
+ function () {
20
+ return Steedos.getObjectsOptions();
21
+ }
18
22
  sort_no: 120
19
23
  active:
20
24
  label: 启用
@@ -16,8 +16,7 @@ module.exports = {
16
16
  }
17
17
  });
18
18
  },
19
- customizeVisible: function (object_name, record_id, record_permissions, data) {
20
- var record = data && data.record;
19
+ customizeVisible: function (object_name, record_id, record_permissions, record) {
21
20
  if (!record) {
22
21
  record = {}
23
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-permission",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
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": "3ef6bf3744c616d6a961b3264e5f204b9697ef6a"
15
+ "gitHead": "e81279db5d8aab35332334cf3eeecf5fd8ead99f"
16
16
  }
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-07-29 09:40:31
4
4
  * @LastEditors: sunhaolin@hotoa.com
5
- * @LastEditTime: 2022-12-09 13:41:11
5
+ * @LastEditTime: 2022-07-29 14:37:14
6
6
  * @Description:
7
7
  */
8
8
  "use strict";
@@ -22,8 +22,7 @@ module.exports = {
22
22
  settings: {
23
23
  packageInfo: {
24
24
  path: __dirname,
25
- name: packageName,
26
- isPackage: false
25
+ name: packageName
27
26
  }
28
27
  },
29
28