@steedos/standard-permission 2.5.3-beta.2 → 2.5.3-beta.21
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/main/default/objectTranslations/permission_set.en/permission_set.en.objectTranslation.yml +29 -6
- package/main/default/objectTranslations/permission_set.zh-CN/permission_set.zh-CN.objectTranslation.yml +27 -4
- package/main/default/objects/permission_set/buttons/permission_set.action.js +3 -1
- package/main/default/objects/permission_set/permission_set.object.yml +28 -9
- package/main/default/objects/permission_tabs/permissions/customer.permission.yml +3 -3
- package/main/default/routes/copyProfile.router.js +2 -2
- package/main/default/triggers/permission_fields.trigger.js +10 -3
- package/main/default/triggers/permission_objects.trigger.js +2 -1
- package/main/default/triggers/permission_set.trigger.js +11 -3
- package/main/default/triggers/permission_tabs_metadata.trigger.js +4 -3
- package/main/default/triggers/restriction_rules.trigger.js +10 -2
- package/main/default/triggers/share_rules.trigger.js +10 -2
- package/main/default/triggers/share_rules_api_name.trigger.js +2 -2
- package/package.json +2 -2
package/main/default/objectTranslations/permission_set.en/permission_set.en.objectTranslation.yml
CHANGED
|
@@ -19,14 +19,37 @@ fields:
|
|
|
19
19
|
- label: Permission set
|
|
20
20
|
value: permission_set
|
|
21
21
|
description:
|
|
22
|
-
license:
|
|
23
|
-
label: License
|
|
24
|
-
help:
|
|
25
|
-
description:
|
|
26
22
|
assigned_apps:
|
|
27
23
|
label: Assigned Apps
|
|
28
24
|
help:
|
|
29
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
|
|
30
53
|
users:
|
|
31
54
|
label: Users
|
|
32
55
|
help: 'When the type is a profile, no user needs to be selected'
|
|
@@ -85,9 +108,9 @@ listviews:
|
|
|
85
108
|
all:
|
|
86
109
|
label: All
|
|
87
110
|
permission_set:
|
|
88
|
-
label: Permission
|
|
111
|
+
label: Permission Sets
|
|
89
112
|
profile:
|
|
90
|
-
label:
|
|
113
|
+
label: Profiles
|
|
91
114
|
actions:
|
|
92
115
|
customize:
|
|
93
116
|
label: Customize
|
|
@@ -19,14 +19,37 @@ fields:
|
|
|
19
19
|
- label: 权限集
|
|
20
20
|
value: permission_set
|
|
21
21
|
description:
|
|
22
|
-
license:
|
|
23
|
-
label: 许可证
|
|
24
|
-
help:
|
|
25
|
-
description:
|
|
26
22
|
assigned_apps:
|
|
27
23
|
label: 授权应用
|
|
28
24
|
help:
|
|
29
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
|
|
30
53
|
users:
|
|
31
54
|
label: 成员
|
|
32
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
|
|
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
|
}
|
|
@@ -26,15 +26,6 @@ fields:
|
|
|
26
26
|
firstOption: false
|
|
27
27
|
options: Profile:profile,Permission set:permission_set
|
|
28
28
|
defaultValue: permission_set
|
|
29
|
-
license:
|
|
30
|
-
label: License
|
|
31
|
-
type: lookup
|
|
32
|
-
optionsFunction: !!js/function
|
|
33
|
-
function(){
|
|
34
|
-
return Steedos.getLicenseOptions();
|
|
35
|
-
}
|
|
36
|
-
showIcon: false
|
|
37
|
-
# required: "{{ 'profile' === formData.type }}"
|
|
38
29
|
assigned_apps:
|
|
39
30
|
label: Assigned Apps
|
|
40
31
|
type: lookup
|
|
@@ -43,6 +34,34 @@ fields:
|
|
|
43
34
|
reference_to_field: code
|
|
44
35
|
name: assigned_apps
|
|
45
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}}"
|
|
46
65
|
users:
|
|
47
66
|
label: Users
|
|
48
67
|
type: lookup
|
|
@@ -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-
|
|
5
|
+
* @LastEditTime: 2023-06-14 10:49:23
|
|
6
6
|
* @Description: 复制已有简档来创建新简档
|
|
7
7
|
* 使用mongodb的事务处理,保证数据的一致性
|
|
8
8
|
* 复制对象包括:简档、对象权限、字段权限、选项卡权限
|
|
@@ -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
|
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-08-05 14:17:44
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 17:08:43
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
1
8
|
const objectql = require('@steedos/objectql');
|
|
2
9
|
const auth = require('@steedos/auth');
|
|
3
10
|
const clone = require('clone');
|
|
4
11
|
const _ = require('underscore');
|
|
5
12
|
const readonlyFields = ['created', 'created_by', 'modified', 'modified_by'];
|
|
6
|
-
|
|
13
|
+
const register = require('@steedos/metadata-registrar');
|
|
7
14
|
async function getAll() {
|
|
8
15
|
const schema = objectql.getSteedosSchema();
|
|
9
|
-
const configs = await
|
|
16
|
+
const configs = await register.registerPermissionFields.getAll(schema.broker)
|
|
10
17
|
const dataList = _.pluck(configs, 'metadata');
|
|
11
18
|
|
|
12
19
|
_.each(dataList, function (item) {
|
|
@@ -19,7 +26,7 @@ async function getAll() {
|
|
|
19
26
|
|
|
20
27
|
async function get(apiName) {
|
|
21
28
|
const schema = objectql.getSteedosSchema();
|
|
22
|
-
const config = await
|
|
29
|
+
const config = await register.registerPermissionFields.get(schema.broker, apiName)
|
|
23
30
|
return config ? config.metadata : null;
|
|
24
31
|
}
|
|
25
32
|
|
|
@@ -3,6 +3,7 @@ const objectql = require("@steedos/objectql");
|
|
|
3
3
|
const InternalData = require('@steedos/standard-objects').internalData;
|
|
4
4
|
const auth = require("@steedos/auth");
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
const permissions = {
|
|
7
8
|
allowEdit: false,
|
|
8
9
|
allowDelete: false,
|
|
@@ -104,7 +105,7 @@ module.exports = {
|
|
|
104
105
|
filters: [
|
|
105
106
|
['_id', '=', permissionSetId],
|
|
106
107
|
]
|
|
107
|
-
})[0]
|
|
108
|
+
}))[0];
|
|
108
109
|
if (permissionSetDoc) {
|
|
109
110
|
// 替换this.query.filters中全部的的permission_set_id为permissionSetDoc.name
|
|
110
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}')`);
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-08-05 14:17:44
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 15:10:02
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
1
8
|
const _ = require('underscore');
|
|
2
9
|
const objectql = require('@steedos/objectql');
|
|
10
|
+
const register = require('@steedos/metadata-registrar');
|
|
3
11
|
const auth = require("@steedos/auth");
|
|
4
12
|
|
|
5
13
|
|
|
6
14
|
const getSourcePermissionSets = async function(type){
|
|
7
15
|
switch (type) {
|
|
8
16
|
case 'permission_set':
|
|
9
|
-
return await
|
|
17
|
+
return await register.getSourcePermissionsets();
|
|
10
18
|
case 'profile':
|
|
11
|
-
return await
|
|
19
|
+
return await register.getSourceProfiles();
|
|
12
20
|
default:
|
|
13
|
-
return (await
|
|
21
|
+
return (await register.getSourceProfiles()).concat((await register.getSourcePermissionsets()));
|
|
14
22
|
}
|
|
15
23
|
|
|
16
24
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 2022-10-26 14:14:51
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 15:09:54
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const objectql = require('@steedos/objectql');
|
|
9
|
+
const register = require('@steedos/metadata-registrar');
|
|
9
10
|
const auth = require('@steedos/auth');
|
|
10
11
|
const _ = require('underscore');
|
|
11
12
|
async function getAll() {
|
|
12
13
|
const schema = objectql.getSteedosSchema();
|
|
13
|
-
const configs = await
|
|
14
|
+
const configs = await register.registerTab.getAll(schema.broker)
|
|
14
15
|
const dataList = _.pluck(configs, 'metadata');
|
|
15
16
|
let permissionTabs = [];
|
|
16
17
|
for (const item of dataList) {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-08-05 14:17:44
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 17:06:59
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
1
8
|
const objectql = require('@steedos/objectql');
|
|
9
|
+
const register = require('@steedos/metadata-registrar');
|
|
2
10
|
const auth = require('@steedos/auth');
|
|
3
11
|
const _ = require('underscore');
|
|
4
12
|
const clone = require('clone');
|
|
5
13
|
async function getAll() {
|
|
6
14
|
const schema = objectql.getSteedosSchema();
|
|
7
|
-
const configs = await
|
|
15
|
+
const configs = await register.registerRestrictionRules.getAll(schema.broker)
|
|
8
16
|
const dataList = _.pluck(configs, 'metadata');
|
|
9
17
|
|
|
10
18
|
_.each(dataList, function (item) {
|
|
@@ -17,7 +25,7 @@ async function getAll() {
|
|
|
17
25
|
|
|
18
26
|
async function get(apiName) {
|
|
19
27
|
const schema = objectql.getSteedosSchema();
|
|
20
|
-
const config = await
|
|
28
|
+
const config = await register.registerRestrictionRules.get(schema.broker, apiName)
|
|
21
29
|
return config ? Object.assign(config.metadata, { _id: config.metadata._id || `${config.metadata.object_name}.${config.metadata.name}` }) : null;
|
|
22
30
|
}
|
|
23
31
|
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: baozhoutao@steedos.com
|
|
3
|
+
* @Date: 2022-08-05 14:17:44
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 17:07:49
|
|
6
|
+
* @Description:
|
|
7
|
+
*/
|
|
1
8
|
const objectql = require('@steedos/objectql');
|
|
2
9
|
const auth = require('@steedos/auth');
|
|
10
|
+
const register = require('@steedos/metadata-registrar');
|
|
3
11
|
const _ = require('underscore');
|
|
4
12
|
const clone = require('clone');
|
|
5
13
|
async function getAll() {
|
|
6
14
|
const schema = objectql.getSteedosSchema();
|
|
7
|
-
const configs = await
|
|
15
|
+
const configs = await register.registerShareRules.getAll(schema.broker)
|
|
8
16
|
const dataList = _.pluck(configs, 'metadata');
|
|
9
17
|
|
|
10
18
|
_.each(dataList, function (item) {
|
|
@@ -17,7 +25,7 @@ async function getAll() {
|
|
|
17
25
|
|
|
18
26
|
async function get(apiName) {
|
|
19
27
|
const schema = objectql.getSteedosSchema();
|
|
20
|
-
const config = await
|
|
28
|
+
const config = await register.registerShareRules.get(schema.broker, apiName)
|
|
21
29
|
return config ? Object.assign(config.metadata, { _id: config.metadata._id || `${config.metadata.object_name}.${config.metadata.name}` }) : null;
|
|
22
30
|
}
|
|
23
31
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* @Author: sunhaolin@hotoa.com
|
|
3
3
|
* @Date: 2021-12-27 10:49:33
|
|
4
|
-
* @LastEditors:
|
|
5
|
-
* @LastEditTime:
|
|
4
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
5
|
+
* @LastEditTime: 2023-05-30 17:07:59
|
|
6
6
|
* @Description:
|
|
7
7
|
*/
|
|
8
8
|
const util = require('@steedos/standard-objects').util;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-permission",
|
|
3
|
-
"version": "2.5.3-beta.
|
|
3
|
+
"version": "2.5.3-beta.21",
|
|
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": "
|
|
15
|
+
"gitHead": "b4313a2ef5d18ef1cf9271bd3c89b2d6fe52d65b"
|
|
16
16
|
}
|