@steedos/standard-permission 2.2.55-beta.16
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/applications/.gitkeep +0 -0
- package/main/default/client/permission_set.client.js +38 -0
- package/main/default/objectTranslations/permission_objects.en/permission_objects.en.objectTranslation.yml +108 -0
- package/main/default/objectTranslations/permission_objects.zh-CN/permission_objects.zh-CN.objectTranslation.yml +108 -0
- package/main/default/objectTranslations/permission_set.en/permission_set.en.objectTranslation.yml +87 -0
- package/main/default/objectTranslations/permission_set.zh-CN/permission_set.zh-CN.objectTranslation.yml +87 -0
- package/main/default/objectTranslations/permission_shares.en/permission_shares.en.objectTranslation.yml +27 -0
- package/main/default/objectTranslations/permission_shares.zh-CN/permission_shares.zh-CN.objectTranslation.yml +27 -0
- package/main/default/objects/permission_fields.object.yml +184 -0
- package/main/default/objects/permission_objects.action.js +57 -0
- package/main/default/objects/permission_objects.function.js +23 -0
- package/main/default/objects/permission_objects.object.js +20 -0
- package/main/default/objects/permission_objects.object.yml +394 -0
- package/main/default/objects/permission_set/buttons/permission_set.action.js +17 -0
- package/main/default/objects/permission_set/permission_set.object.yml +268 -0
- package/main/default/objects/permission_shares.object.js +57 -0
- package/main/default/objects/permission_shares.object.yml +63 -0
- package/main/default/objects/restriction_rules.action.js +25 -0
- package/main/default/objects/restriction_rules.object.yml +82 -0
- package/main/default/objects/share_rules.action.js +25 -0
- package/main/default/objects/share_rules.object.yml +82 -0
- package/main/default/permissionsets/.gitkeep +0 -0
- package/main/default/profiles/.gitkeep +0 -0
- package/main/default/routes/copyProfile.router.js +113 -0
- package/main/default/server/permission_set.object.js +130 -0
- package/main/default/tabs/.gitkeep +0 -0
- package/main/default/triggers/.gitkeep +0 -0
- package/main/default/triggers/permission_fields.trigger.js +94 -0
- package/main/default/triggers/permission_objects.trigger.js +159 -0
- package/main/default/triggers/permission_set.trigger.js +89 -0
- package/main/default/triggers/restriction_rules.trigger.js +67 -0
- package/main/default/triggers/restriction_rules_api_name.trigger.js +30 -0
- package/main/default/triggers/share_rules.trigger.js +68 -0
- package/main/default/triggers/share_rules_api_name.trigger.js +30 -0
- package/package.json +16 -0
- package/package.service.js +75 -0
- package/public/.md +3 -0
- package/src/.md +3 -0
- package/webapp/.md +1 -0
|
File without changes
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Steedos.PermissionSetManager = {};
|
|
2
|
+
|
|
3
|
+
Steedos.PermissionSetManager.changeSchema = function(doc, schema){
|
|
4
|
+
var objectSchema = Creator.getObjectSchema(Creator.getObject("permission_set"));
|
|
5
|
+
|
|
6
|
+
var hiddenField = function(fieldName){
|
|
7
|
+
schema._schema[fieldName].autoform.omit = true;
|
|
8
|
+
schema._schema[fieldName].autoform.type = 'hidden';
|
|
9
|
+
schema._schema[fieldName].optional = true;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if(doc.type == 'profile'){
|
|
13
|
+
hiddenField('users');
|
|
14
|
+
schema._schema.license = objectSchema.license;
|
|
15
|
+
schema._schema.license.optional = false;
|
|
16
|
+
schema._schema.password_history = objectSchema.password_history;
|
|
17
|
+
schema._schema.max_login_attempts = objectSchema.max_login_attempts;
|
|
18
|
+
schema._schema.lockout_interval = objectSchema.lockout_interval;
|
|
19
|
+
schema._schema.enable_MFA = objectSchema.enable_MFA;
|
|
20
|
+
schema._schema.logout_other_clients = objectSchema.logout_other_clients;
|
|
21
|
+
schema._schema.login_expiration_in_days = objectSchema.login_expiration_in_days;
|
|
22
|
+
schema._schema.phone_logout_other_clients = objectSchema.phone_logout_other_clients;
|
|
23
|
+
schema._schema.phone_login_expiration_in_days = objectSchema.phone_login_expiration_in_days;
|
|
24
|
+
}else{
|
|
25
|
+
hiddenField('password_history');
|
|
26
|
+
hiddenField('max_login_attempts');
|
|
27
|
+
hiddenField('lockout_interval');
|
|
28
|
+
hiddenField('enable_MFA');
|
|
29
|
+
hiddenField('logout_other_clients');
|
|
30
|
+
hiddenField('login_expiration_in_days');
|
|
31
|
+
hiddenField('phone_logout_other_clients');
|
|
32
|
+
hiddenField('phone_login_expiration_in_days');
|
|
33
|
+
schema._schema.license.optional = true;
|
|
34
|
+
schema._schema.license.defaultValue = null;
|
|
35
|
+
schema._schema.license.autoform.defaultValue = null;
|
|
36
|
+
schema._schema.users = objectSchema.users;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: permission_objects
|
|
2
|
+
label: Permission
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: Name
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
permission_set_id:
|
|
10
|
+
label: Permission Set
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
object_name:
|
|
14
|
+
label: Object
|
|
15
|
+
help:
|
|
16
|
+
description:
|
|
17
|
+
allowRead:
|
|
18
|
+
label: Allow Read
|
|
19
|
+
help:
|
|
20
|
+
description:
|
|
21
|
+
allowCreate:
|
|
22
|
+
label: Allow Create
|
|
23
|
+
help:
|
|
24
|
+
description:
|
|
25
|
+
allowEdit:
|
|
26
|
+
label: Allow Edit
|
|
27
|
+
help:
|
|
28
|
+
description:
|
|
29
|
+
allowDelete:
|
|
30
|
+
label: Allow Delete
|
|
31
|
+
help:
|
|
32
|
+
description:
|
|
33
|
+
viewAllRecords:
|
|
34
|
+
label: View All Records
|
|
35
|
+
help:
|
|
36
|
+
description:
|
|
37
|
+
modifyAllRecords:
|
|
38
|
+
label: Modify All Records
|
|
39
|
+
help:
|
|
40
|
+
description:
|
|
41
|
+
viewCompanyRecords:
|
|
42
|
+
label: View Division's Records
|
|
43
|
+
help:
|
|
44
|
+
description:
|
|
45
|
+
modifyCompanyRecords:
|
|
46
|
+
label: Modify Division's Records
|
|
47
|
+
help:
|
|
48
|
+
description:
|
|
49
|
+
allowReadFiles:
|
|
50
|
+
label: Allow Read Files
|
|
51
|
+
help:
|
|
52
|
+
description:
|
|
53
|
+
allowCreateFiles:
|
|
54
|
+
label: Allow Create Files
|
|
55
|
+
help:
|
|
56
|
+
description:
|
|
57
|
+
allowEditFiles:
|
|
58
|
+
label: Allow Edit Files
|
|
59
|
+
help:
|
|
60
|
+
description:
|
|
61
|
+
allowDeleteFiles:
|
|
62
|
+
label: Allow Delete Files
|
|
63
|
+
help:
|
|
64
|
+
description:
|
|
65
|
+
viewAllFiles:
|
|
66
|
+
label: View All Files
|
|
67
|
+
help:
|
|
68
|
+
description:
|
|
69
|
+
modifyAllFiles:
|
|
70
|
+
label: Modify All Files
|
|
71
|
+
help:
|
|
72
|
+
description:
|
|
73
|
+
disabled_list_views:
|
|
74
|
+
label: Disabled ListViews
|
|
75
|
+
help:
|
|
76
|
+
description:
|
|
77
|
+
disabled_actions:
|
|
78
|
+
label: Disabled Actions
|
|
79
|
+
help:
|
|
80
|
+
description:
|
|
81
|
+
unreadable_fields:
|
|
82
|
+
label: Unreadable Fields
|
|
83
|
+
help:
|
|
84
|
+
description:
|
|
85
|
+
uneditable_fields:
|
|
86
|
+
label: Uneditable Fields
|
|
87
|
+
help:
|
|
88
|
+
description:
|
|
89
|
+
unrelated_objects:
|
|
90
|
+
label: Unrelated Objects
|
|
91
|
+
help:
|
|
92
|
+
description:
|
|
93
|
+
is_system:
|
|
94
|
+
label: 系统
|
|
95
|
+
help:
|
|
96
|
+
description:
|
|
97
|
+
groups:
|
|
98
|
+
files_permissions: Files permissions
|
|
99
|
+
listviews:
|
|
100
|
+
customize:
|
|
101
|
+
label: Customize
|
|
102
|
+
system:
|
|
103
|
+
label: System
|
|
104
|
+
all:
|
|
105
|
+
label: All
|
|
106
|
+
actions:
|
|
107
|
+
customize:
|
|
108
|
+
label: Customize
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
name: permission_objects
|
|
2
|
+
label: 对象权限
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: 名称
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
permission_set_id:
|
|
10
|
+
label: 权限集
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
object_name:
|
|
14
|
+
label: 对象
|
|
15
|
+
help:
|
|
16
|
+
description:
|
|
17
|
+
allowRead:
|
|
18
|
+
label: 允许查看
|
|
19
|
+
help:
|
|
20
|
+
description:
|
|
21
|
+
allowCreate:
|
|
22
|
+
label: 允许创建
|
|
23
|
+
help:
|
|
24
|
+
description:
|
|
25
|
+
allowEdit:
|
|
26
|
+
label: 允许编辑
|
|
27
|
+
help:
|
|
28
|
+
description:
|
|
29
|
+
allowDelete:
|
|
30
|
+
label: 允许删除
|
|
31
|
+
help:
|
|
32
|
+
description:
|
|
33
|
+
viewAllRecords:
|
|
34
|
+
label: 查看所有记录
|
|
35
|
+
help:
|
|
36
|
+
description:
|
|
37
|
+
modifyAllRecords:
|
|
38
|
+
label: 修改所有记录
|
|
39
|
+
help:
|
|
40
|
+
description:
|
|
41
|
+
viewCompanyRecords:
|
|
42
|
+
label: 查看本分部
|
|
43
|
+
help:
|
|
44
|
+
description:
|
|
45
|
+
modifyCompanyRecords:
|
|
46
|
+
label: 修改本分部
|
|
47
|
+
help:
|
|
48
|
+
description:
|
|
49
|
+
allowReadFiles:
|
|
50
|
+
label: 允许查看附件
|
|
51
|
+
help:
|
|
52
|
+
description:
|
|
53
|
+
allowCreateFiles:
|
|
54
|
+
label: 允许创建附件
|
|
55
|
+
help:
|
|
56
|
+
description:
|
|
57
|
+
allowEditFiles:
|
|
58
|
+
label: 允许修改附件
|
|
59
|
+
help:
|
|
60
|
+
description:
|
|
61
|
+
allowDeleteFiles:
|
|
62
|
+
label: 允许删除附件
|
|
63
|
+
help:
|
|
64
|
+
description:
|
|
65
|
+
viewAllFiles:
|
|
66
|
+
label: 查看所有附件
|
|
67
|
+
help:
|
|
68
|
+
description:
|
|
69
|
+
modifyAllFiles:
|
|
70
|
+
label: 修改所有附件
|
|
71
|
+
help:
|
|
72
|
+
description:
|
|
73
|
+
disabled_list_views:
|
|
74
|
+
label: 禁用列表视图
|
|
75
|
+
help:
|
|
76
|
+
description:
|
|
77
|
+
disabled_actions:
|
|
78
|
+
label: 禁用操作
|
|
79
|
+
help:
|
|
80
|
+
description:
|
|
81
|
+
unreadable_fields:
|
|
82
|
+
label: 不可见字段
|
|
83
|
+
help:
|
|
84
|
+
description:
|
|
85
|
+
uneditable_fields:
|
|
86
|
+
label: 不可编辑字段
|
|
87
|
+
help:
|
|
88
|
+
description:
|
|
89
|
+
unrelated_objects:
|
|
90
|
+
label: 禁用关联对象
|
|
91
|
+
help:
|
|
92
|
+
description:
|
|
93
|
+
is_system:
|
|
94
|
+
label: 系统
|
|
95
|
+
help:
|
|
96
|
+
description:
|
|
97
|
+
groups:
|
|
98
|
+
files_permissions: 附件权限
|
|
99
|
+
listviews:
|
|
100
|
+
customize:
|
|
101
|
+
label: 自定义
|
|
102
|
+
system:
|
|
103
|
+
label: 系统
|
|
104
|
+
all:
|
|
105
|
+
label: 全部
|
|
106
|
+
actions:
|
|
107
|
+
customize:
|
|
108
|
+
label: 自定义
|
package/main/default/objectTranslations/permission_set.en/permission_set.en.objectTranslation.yml
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: permission_set
|
|
2
|
+
label: Permission Set
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: Name
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
label:
|
|
10
|
+
label: Label
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
type:
|
|
14
|
+
label: Type
|
|
15
|
+
help:
|
|
16
|
+
options:
|
|
17
|
+
- label: Profile
|
|
18
|
+
value: profile
|
|
19
|
+
- label: Permission set
|
|
20
|
+
value: permission_set
|
|
21
|
+
description:
|
|
22
|
+
license:
|
|
23
|
+
label: License
|
|
24
|
+
help:
|
|
25
|
+
description:
|
|
26
|
+
assigned_apps:
|
|
27
|
+
label: Assigned Apps
|
|
28
|
+
help:
|
|
29
|
+
description:
|
|
30
|
+
users:
|
|
31
|
+
label: Users
|
|
32
|
+
help: 'When the type is a profile, no user needs to be selected'
|
|
33
|
+
description:
|
|
34
|
+
is_system:
|
|
35
|
+
label: System
|
|
36
|
+
help:
|
|
37
|
+
description:
|
|
38
|
+
password_history:
|
|
39
|
+
label: 强制密码历史
|
|
40
|
+
help:
|
|
41
|
+
description:
|
|
42
|
+
max_login_attempts:
|
|
43
|
+
label: 最大无效登录尝试次数
|
|
44
|
+
help:
|
|
45
|
+
options:
|
|
46
|
+
- label: '3'
|
|
47
|
+
value: '3'
|
|
48
|
+
- label: '5'
|
|
49
|
+
value: '5'
|
|
50
|
+
- label: '10'
|
|
51
|
+
value: '10'
|
|
52
|
+
- label: 无限制
|
|
53
|
+
value: '0'
|
|
54
|
+
description:
|
|
55
|
+
lockout_interval:
|
|
56
|
+
label: 锁定有效期间
|
|
57
|
+
help:
|
|
58
|
+
options:
|
|
59
|
+
- label: 15 分钟
|
|
60
|
+
value: '15'
|
|
61
|
+
- label: 30 分钟
|
|
62
|
+
value: '30'
|
|
63
|
+
- label: 60 分钟
|
|
64
|
+
value: '60'
|
|
65
|
+
- label: 始终(必须由管理员重置)
|
|
66
|
+
value: '0'
|
|
67
|
+
description:
|
|
68
|
+
groups:
|
|
69
|
+
profile_password_policy: profile password policy
|
|
70
|
+
listviews:
|
|
71
|
+
all:
|
|
72
|
+
label: All
|
|
73
|
+
permission_set:
|
|
74
|
+
label: Permission Set
|
|
75
|
+
profile:
|
|
76
|
+
label: Profile
|
|
77
|
+
actions:
|
|
78
|
+
customize:
|
|
79
|
+
label: Customize
|
|
80
|
+
CustomLabels:
|
|
81
|
+
permission_set_admin: Admin
|
|
82
|
+
permission_set_user: User
|
|
83
|
+
permission_set_supplier: Supplier
|
|
84
|
+
permission_set_customer: Customer
|
|
85
|
+
permission_set_field_license_options_platform:
|
|
86
|
+
permission_set_field_license_options_community:
|
|
87
|
+
permission_set_field_password_history_options:
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
name: permission_set
|
|
2
|
+
label: 权限集
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: API名称
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
label:
|
|
10
|
+
label: 显示名称
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
type:
|
|
14
|
+
label: 类别
|
|
15
|
+
help:
|
|
16
|
+
options:
|
|
17
|
+
- label: 简档
|
|
18
|
+
value: profile
|
|
19
|
+
- label: 权限集
|
|
20
|
+
value: permission_set
|
|
21
|
+
description:
|
|
22
|
+
license:
|
|
23
|
+
label: 许可证
|
|
24
|
+
help:
|
|
25
|
+
description:
|
|
26
|
+
assigned_apps:
|
|
27
|
+
label: 授权应用
|
|
28
|
+
help:
|
|
29
|
+
description:
|
|
30
|
+
users:
|
|
31
|
+
label: 成员
|
|
32
|
+
help: 类别为简档时,不需要选择成员
|
|
33
|
+
description:
|
|
34
|
+
is_system:
|
|
35
|
+
label: 系统
|
|
36
|
+
help:
|
|
37
|
+
description:
|
|
38
|
+
password_history:
|
|
39
|
+
label: 强制密码历史
|
|
40
|
+
help:
|
|
41
|
+
description:
|
|
42
|
+
max_login_attempts:
|
|
43
|
+
label: 最大无效登录尝试次数
|
|
44
|
+
help:
|
|
45
|
+
options:
|
|
46
|
+
- label: '3'
|
|
47
|
+
value: '3'
|
|
48
|
+
- label: '5'
|
|
49
|
+
value: '5'
|
|
50
|
+
- label: '10'
|
|
51
|
+
value: '10'
|
|
52
|
+
- label: 无限制
|
|
53
|
+
value: '0'
|
|
54
|
+
description:
|
|
55
|
+
lockout_interval:
|
|
56
|
+
label: 锁定有效期间
|
|
57
|
+
help:
|
|
58
|
+
options:
|
|
59
|
+
- label: 15 分钟
|
|
60
|
+
value: '15'
|
|
61
|
+
- label: 30 分钟
|
|
62
|
+
value: '30'
|
|
63
|
+
- label: 60 分钟
|
|
64
|
+
value: '60'
|
|
65
|
+
- label: 始终(必须由管理员重置)
|
|
66
|
+
value: '0'
|
|
67
|
+
description:
|
|
68
|
+
groups:
|
|
69
|
+
profile_password_policy: 密码策略
|
|
70
|
+
listviews:
|
|
71
|
+
all:
|
|
72
|
+
label: 全部
|
|
73
|
+
permission_set:
|
|
74
|
+
label: 权限集
|
|
75
|
+
profile:
|
|
76
|
+
label: 简档
|
|
77
|
+
actions:
|
|
78
|
+
customize:
|
|
79
|
+
label: 自定义
|
|
80
|
+
CustomLabels:
|
|
81
|
+
permission_set_admin: 管理员
|
|
82
|
+
permission_set_user: 用户
|
|
83
|
+
permission_set_supplier: 供应商
|
|
84
|
+
permission_set_customer: 客户
|
|
85
|
+
permission_set_field_license_options_platform: 华炎魔方
|
|
86
|
+
permission_set_field_license_options_community: 华炎社区
|
|
87
|
+
permission_set_field_password_history_options: 记住 %s 个密码
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: permission_shares
|
|
2
|
+
label: Permission Share
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: Name
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
object_name:
|
|
10
|
+
label: Object
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
filters:
|
|
14
|
+
label: Filters
|
|
15
|
+
help: Format of OData Filters Required.
|
|
16
|
+
description:
|
|
17
|
+
organizations:
|
|
18
|
+
label: Departments
|
|
19
|
+
help:
|
|
20
|
+
description:
|
|
21
|
+
users:
|
|
22
|
+
label: Users
|
|
23
|
+
help:
|
|
24
|
+
description:
|
|
25
|
+
listviews:
|
|
26
|
+
all:
|
|
27
|
+
label: All
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: permission_shares
|
|
2
|
+
label: 共享规则
|
|
3
|
+
description:
|
|
4
|
+
fields:
|
|
5
|
+
name:
|
|
6
|
+
label: 名称
|
|
7
|
+
help:
|
|
8
|
+
description:
|
|
9
|
+
object_name:
|
|
10
|
+
label: 对象
|
|
11
|
+
help:
|
|
12
|
+
description:
|
|
13
|
+
filters:
|
|
14
|
+
label: 过滤条件
|
|
15
|
+
help: 格式为odata filters
|
|
16
|
+
description:
|
|
17
|
+
organizations:
|
|
18
|
+
label: 授权组织
|
|
19
|
+
help:
|
|
20
|
+
description:
|
|
21
|
+
users:
|
|
22
|
+
label: 授权用户
|
|
23
|
+
help:
|
|
24
|
+
description:
|
|
25
|
+
listviews:
|
|
26
|
+
all:
|
|
27
|
+
label: 全部
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
name: permission_fields
|
|
2
|
+
label: 字段权限
|
|
3
|
+
icon: omni_supervisor
|
|
4
|
+
version: 2
|
|
5
|
+
enable_inline_edit: false
|
|
6
|
+
hidden: true
|
|
7
|
+
fields:
|
|
8
|
+
name:
|
|
9
|
+
label: Api 名称
|
|
10
|
+
type: text
|
|
11
|
+
readonly: true
|
|
12
|
+
sort_no: 100
|
|
13
|
+
permission_set_id:
|
|
14
|
+
label: 权限集
|
|
15
|
+
type: lookup
|
|
16
|
+
reference_to: permission_set
|
|
17
|
+
index: true
|
|
18
|
+
name: permission_set_id
|
|
19
|
+
filterable: true
|
|
20
|
+
reference_to_field: name
|
|
21
|
+
readonly: true
|
|
22
|
+
sort_no: 110
|
|
23
|
+
permission_object:
|
|
24
|
+
label: 对象权限
|
|
25
|
+
type: master_detail
|
|
26
|
+
required: true
|
|
27
|
+
reference_to: permission_objects
|
|
28
|
+
index: true
|
|
29
|
+
name: permission_object
|
|
30
|
+
reference_to_field: name
|
|
31
|
+
filterable: true
|
|
32
|
+
hidden: false
|
|
33
|
+
readonly: true
|
|
34
|
+
sort_no: 120
|
|
35
|
+
object_name:
|
|
36
|
+
readonly: true
|
|
37
|
+
label: 对象
|
|
38
|
+
type: lookup
|
|
39
|
+
reference_to: objects
|
|
40
|
+
write_requires_master_read: true
|
|
41
|
+
reference_to_field: name
|
|
42
|
+
index: true
|
|
43
|
+
required: true
|
|
44
|
+
create: false
|
|
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
|
+
}
|
|
64
|
+
name: object_name
|
|
65
|
+
filterable: true
|
|
66
|
+
field:
|
|
67
|
+
readonly: true
|
|
68
|
+
type: lookup
|
|
69
|
+
label: 字段
|
|
70
|
+
reference_to: object_fields
|
|
71
|
+
reference_to_field: name
|
|
72
|
+
sort_no: 140
|
|
73
|
+
depend_on:
|
|
74
|
+
- object_name
|
|
75
|
+
defaultIcon: service_contract
|
|
76
|
+
filtersFunction: !<tag:yaml.org,2002:js/function> |-
|
|
77
|
+
function (filters, values) {
|
|
78
|
+
if(values && values.object_name){
|
|
79
|
+
if(values._grid_row_id){
|
|
80
|
+
var selected = _.find(values.fields, function(item){return item._id==values._grid_row_id});
|
|
81
|
+
var selectedAll = _.pluck(values.fields, 'field_name');
|
|
82
|
+
if(selected){
|
|
83
|
+
selectedAll = _.difference(selectedAll, [selected.field_name]);
|
|
84
|
+
}
|
|
85
|
+
if(selectedAll && selectedAll.length > 0){
|
|
86
|
+
return [['object', '=', values.object_name], ['name', '!=', selectedAll]]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return ['object', '=', values.object_name]
|
|
90
|
+
}else{
|
|
91
|
+
return ['_id', '=', 'no']
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
readable:
|
|
95
|
+
type: boolean
|
|
96
|
+
label: 允许查看
|
|
97
|
+
sort_no: 150
|
|
98
|
+
editable:
|
|
99
|
+
label: 允许编辑
|
|
100
|
+
type: boolean
|
|
101
|
+
sort_no: 160
|
|
102
|
+
is_system:
|
|
103
|
+
type: boolean
|
|
104
|
+
label: 系统
|
|
105
|
+
# omit: true
|
|
106
|
+
readonly: true
|
|
107
|
+
visible_on: "{{global.mode ==='read' ? true : false}}"
|
|
108
|
+
disabled: true
|
|
109
|
+
sort_no: 170
|
|
110
|
+
paging:
|
|
111
|
+
enabled: false
|
|
112
|
+
actions:
|
|
113
|
+
standard_new:
|
|
114
|
+
label: standard_new
|
|
115
|
+
visible: !!js/function |
|
|
116
|
+
function(){
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
list_views:
|
|
120
|
+
customize:
|
|
121
|
+
columns:
|
|
122
|
+
- permission_set_id
|
|
123
|
+
- field
|
|
124
|
+
- readable
|
|
125
|
+
- editable
|
|
126
|
+
- is_system
|
|
127
|
+
label: Customize
|
|
128
|
+
filters:
|
|
129
|
+
- ["is_system","<>",true]
|
|
130
|
+
filter_scope: space
|
|
131
|
+
system:
|
|
132
|
+
columns:
|
|
133
|
+
- permission_set_id
|
|
134
|
+
- field
|
|
135
|
+
- readable
|
|
136
|
+
- editable
|
|
137
|
+
- is_system
|
|
138
|
+
label: System
|
|
139
|
+
filters:
|
|
140
|
+
- ["is_system","=",true]
|
|
141
|
+
filter_scope: space
|
|
142
|
+
all:
|
|
143
|
+
label: All
|
|
144
|
+
columns:
|
|
145
|
+
- permission_set_id
|
|
146
|
+
- field
|
|
147
|
+
- readable
|
|
148
|
+
- editable
|
|
149
|
+
- is_system
|
|
150
|
+
filter_scope: space
|
|
151
|
+
form:
|
|
152
|
+
onValuesChange: !!js/function |
|
|
153
|
+
function(props){
|
|
154
|
+
const { changedValues, values, form } = props;
|
|
155
|
+
const readonlyFields = ['created', 'created_by', 'modified', 'modified_by'];
|
|
156
|
+
if(changedValues.editable){
|
|
157
|
+
if(window._.include(readonlyFields, values.field)){
|
|
158
|
+
return setTimeout(function(){
|
|
159
|
+
form.setFieldsValue({editable: false})
|
|
160
|
+
}, 50)
|
|
161
|
+
}
|
|
162
|
+
form.setFieldsValue({readable: true});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if(_.has(changedValues, 'readable') && !changedValues.readable && values.editable){
|
|
166
|
+
form.setFieldsValue({editable: false})
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
permission_set:
|
|
171
|
+
user:
|
|
172
|
+
allowCreate: false
|
|
173
|
+
allowDelete: false
|
|
174
|
+
allowEdit: false
|
|
175
|
+
allowRead: false
|
|
176
|
+
modifyAllRecords: false
|
|
177
|
+
viewAllRecords: false
|
|
178
|
+
admin:
|
|
179
|
+
allowCreate: false
|
|
180
|
+
allowDelete: true
|
|
181
|
+
allowEdit: true
|
|
182
|
+
allowRead: true
|
|
183
|
+
modifyAllRecords: true
|
|
184
|
+
viewAllRecords: true
|