@steedos/standard-permission 2.5.3-beta.8 → 2.5.4

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.
@@ -23,6 +23,33 @@ fields:
23
23
  label: Assigned Apps
24
24
  help:
25
25
  description:
26
+ default_standard_buttons:
27
+ label: Default Standard Buttons
28
+ help:
29
+ description:
30
+ options:
31
+ - label: Query
32
+ value: standard_query
33
+ - label: New
34
+ value: standard_new
35
+ - label: View
36
+ value: standard_open_view
37
+ - label: Edit
38
+ value: standard_edit
39
+ - label: Delete
40
+ value: standard_delete
41
+ - label: Delete many
42
+ value: standard_delete_many
43
+ - label: Approve
44
+ value: standard_approve
45
+ - label: View instance
46
+ value: standard_view_instance
47
+ - label: Follow
48
+ value: standard_follow
49
+ - label: Submit for approval
50
+ value: standard_submit_for_approval
51
+ - label: Import data
52
+ value: standard_import_data
26
53
  users:
27
54
  label: Users
28
55
  help: 'When the type is a profile, no user needs to be selected'
@@ -81,9 +108,9 @@ listviews:
81
108
  all:
82
109
  label: All
83
110
  permission_set:
84
- label: Permission Set
111
+ label: Permission Sets
85
112
  profile:
86
- label: Profile
113
+ label: Profiles
87
114
  actions:
88
115
  customize:
89
116
  label: Customize
@@ -23,6 +23,33 @@ fields:
23
23
  label: 授权应用
24
24
  help:
25
25
  description:
26
+ default_standard_buttons:
27
+ label: 默认标准按钮
28
+ help:
29
+ description:
30
+ options:
31
+ - label: 查找
32
+ value: standard_query
33
+ - label: 新建
34
+ value: standard_new
35
+ - label: 查看
36
+ value: standard_open_view
37
+ - label: 编辑
38
+ value: standard_edit
39
+ - label: 删除
40
+ value: standard_delete
41
+ - label: 批量删除
42
+ value: standard_delete_many
43
+ - label: 发起审批
44
+ value: standard_approve
45
+ - label: 查看审批单
46
+ value: standard_view_instance
47
+ - label: 关注
48
+ value: standard_follow
49
+ - label: 提请批准
50
+ value: standard_submit_for_approval
51
+ - label: 导入数据
52
+ value: standard_import_data
26
53
  users:
27
54
  label: 成员
28
55
  help: 类别为简档时,不需要选择成员
@@ -1,7 +1,9 @@
1
1
  module.exports = {
2
2
  customize: function (object_name, record_id, fields) {
3
3
  var doc = Creator.odata.get(object_name, record_id)
4
- Creator.odata.insert(object_name, {name: doc.name, label: doc.label, type: doc.type, license: doc.license, lockout_interval: doc.lockout_interval, max_login_attempts: doc.max_login_attempts, password_history: doc.password_history}, function(result, error){
4
+ Creator.odata.insert(object_name, {name: doc.name, label: doc.label, type: doc.type, license: doc.license, lockout_interval: doc.lockout_interval, max_login_attempts: doc.max_login_attempts, password_history: doc.password_history,
5
+ default_standard_buttons: doc.default_standard_buttons
6
+ }, function(result, error){
5
7
  if(result){
6
8
  FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
7
9
  }
@@ -24,7 +24,7 @@ fields:
24
24
  label: Type
25
25
  type: select
26
26
  firstOption: false
27
- options: Profile:profile,Permission set:permission_set
27
+ options: Permission set:permission_set
28
28
  defaultValue: permission_set
29
29
  assigned_apps:
30
30
  label: Assigned Apps
@@ -34,6 +34,34 @@ fields:
34
34
  reference_to_field: code
35
35
  name: assigned_apps
36
36
  filterable: true
37
+ default_standard_buttons:
38
+ label: Default Standard Buttons
39
+ type: select
40
+ multiple: true
41
+ options:
42
+ - label: 查找
43
+ value: standard_query
44
+ - label: 新建
45
+ value: standard_new
46
+ - label: 查看
47
+ value: standard_open_view
48
+ - label: 编辑
49
+ value: standard_edit
50
+ - label: 删除
51
+ value: standard_delete
52
+ - label: 删除
53
+ value: standard_delete_many
54
+ - label: 发起审批
55
+ value: standard_approve
56
+ - label: 查看审批单
57
+ value: standard_view_instance
58
+ - label: 关注
59
+ value: standard_follow
60
+ - label: 提请批准
61
+ value: standard_submit_for_approval
62
+ - label: 导入数据
63
+ value: standard_import_data
64
+ visible_on: "{{'profile' === formData.type ? true: false}}"
37
65
  users:
38
66
  label: Users
39
67
  type: lookup
@@ -9,6 +9,6 @@ allowRead: true
9
9
  allowReadFiles: true
10
10
  modifyAllRecords: false
11
11
  permission_set_id: customer
12
- viewAllFiles: false
13
- viewAllRecords: false
14
- viewCompanyRecords: false
12
+ viewAllFiles: true
13
+ viewAllRecords: true
14
+ viewCompanyRecords: true
@@ -2,7 +2,7 @@
2
2
  * @Author: sunhaolin@hotoa.com
3
3
  * @Date: 2022-05-26 16:56:54
4
4
  * @LastEditors: sunhaolin@hotoa.com
5
- * @LastEditTime: 2023-05-13 17:00:38
5
+ * @LastEditTime: 2023-06-18 12:55:43
6
6
  * @Description: 复制已有简档来创建新简档
7
7
  * 使用mongodb的事务处理,保证数据的一致性
8
8
  * 复制对象包括:简档、对象权限、字段权限、选项卡权限
@@ -53,7 +53,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
53
53
  throw new Error("permission_set is not profile type");
54
54
  }
55
55
 
56
- const { name:originalPermissionSetName } = originalPermissionSet;
56
+ const { name: originalPermissionSetName } = originalPermissionSet;
57
57
 
58
58
  // API名称不能重复
59
59
  const existPermissionSetCount = await psObj.count({
@@ -83,7 +83,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
83
83
  const permissionSetColl = db.collection('permission_set');
84
84
 
85
85
  // Start a transaction
86
- session.startTransaction({ readConcern: { level: "local" }, writeConcern: { w: "majority" } });
86
+ session.startTransaction({ readConcern: { level: "majority" }, writeConcern: { w: "majority" }, readPreference: 'primary' });
87
87
 
88
88
  let newPermissionSet = null;
89
89
 
@@ -113,7 +113,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
113
113
  };
114
114
 
115
115
  delete newPermissionSetData.record_permissions;
116
- const insertPermissionSetResult = await permissionSetColl.insertOne(newPermissionSetData);
116
+ const insertPermissionSetResult = await permissionSetColl.insertOne(newPermissionSetData, { session });
117
117
  newPermissionSet = insertPermissionSetResult.ops[0];
118
118
  // console.log('newPermissionSet', newPermissionSet)
119
119
 
@@ -228,7 +228,7 @@ async function getInternalPermissionObjects(permissionSetId) {
228
228
  filters: [
229
229
  ['_id', '=', permissionSetId],
230
230
  ]
231
- })[0]);
231
+ }))[0];
232
232
  // 如果库中有记录则使用库中的name作为判断条件,否则使用permissionSetId
233
233
  const permissionSetName = permissionSetDoc ? permissionSetDoc.name : permissionSetId;
234
234
 
@@ -105,7 +105,7 @@ module.exports = {
105
105
  filters: [
106
106
  ['_id', '=', permissionSetId],
107
107
  ]
108
- })[0]);
108
+ }))[0];
109
109
  if (permissionSetDoc) {
110
110
  // 替换this.query.filters中全部的的permission_set_id为permissionSetDoc.name
111
111
  this.query.filters = this.query.filters.replace(regex, permissionSetDoc.name).replace(`permission_set_id eq '${permissionSetDoc.name}'`, `(permission_set_id eq '${permissionSetDoc.name}') or (permission_set_id eq '${permissionSetId}')`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/standard-permission",
3
- "version": "2.5.3-beta.8",
3
+ "version": "2.5.4",
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": "7ac3c90fc78437f905b268c700d5ab414ca2c5a1"
15
+ "gitHead": "0b1b93c80e8448e54b77064d976b9e20bfe39727"
16
16
  }