@steedos/standard-permission 2.5.11-beta.1 → 2.5.11-beta.11
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_objects.en/permission_objects.en.objectTranslation.yml +2 -0
- package/main/default/objectTranslations/permission_objects.zh-CN/permission_objects.zh-CN.objectTranslation.yml +2 -0
- package/main/default/objects/permission_objects.object.yml +4 -0
- package/main/default/objects/permission_set/buttons/set_permission_tabs.button.yml +2 -2
- package/main/default/objects/permission_set/permission_set.object.yml +3 -1
- package/main/default/triggers/permission_objects.trigger.js +14 -25
- package/package.json +2 -2
|
@@ -98,6 +98,10 @@ fields:
|
|
|
98
98
|
type: boolean
|
|
99
99
|
label: Modify All Files
|
|
100
100
|
group: Files permissions
|
|
101
|
+
allowCreateListViews:
|
|
102
|
+
type: boolean
|
|
103
|
+
label: Allow Create ListViews
|
|
104
|
+
defaultValue: true
|
|
101
105
|
disabled_list_views:
|
|
102
106
|
type: lookup
|
|
103
107
|
reference_to: object_listviews
|
|
@@ -161,6 +161,6 @@ label: 设置选项卡权限
|
|
|
161
161
|
'on': record_only
|
|
162
162
|
type: amis_button
|
|
163
163
|
visible: !!js/function |
|
|
164
|
-
function (object_name, record_id, record_permissions,
|
|
165
|
-
return
|
|
164
|
+
function (object_name, record_id, record_permissions, data) {
|
|
165
|
+
return data.record.type === 'profile';
|
|
166
166
|
}
|
|
@@ -25,8 +25,10 @@ fields:
|
|
|
25
25
|
label: Type
|
|
26
26
|
type: select
|
|
27
27
|
firstOption: false
|
|
28
|
-
options: Permission set:permission_set
|
|
28
|
+
options: Profile:profile,Permission set:permission_set
|
|
29
29
|
defaultValue: permission_set
|
|
30
|
+
amis:
|
|
31
|
+
"disabledOn": "${global.mode !='read'}"
|
|
30
32
|
assigned_apps:
|
|
31
33
|
label: Assigned Apps
|
|
32
34
|
type: lookup
|
|
@@ -27,7 +27,13 @@ const getInternalPermissionObjects = async function(){
|
|
|
27
27
|
if(!objectJSON._id && !objectJSON.hidden && !_.include(InternalData.hiddenObjects, objectName)){
|
|
28
28
|
let permission_set = objectJSON.permission_set
|
|
29
29
|
_.each(permission_set, function(v, code){
|
|
30
|
-
objectsPermissions.push(Object.assign({}, v, {
|
|
30
|
+
objectsPermissions.push(Object.assign({}, v, {
|
|
31
|
+
_id: `${code}_${objectName}`,
|
|
32
|
+
name: `${code}_${objectName}`,
|
|
33
|
+
permission_set_id: code,
|
|
34
|
+
object_name: objectName,
|
|
35
|
+
allowCreateListViews: v.allowCreateListViews == false ? false : true
|
|
36
|
+
}, baseRecord))
|
|
31
37
|
})
|
|
32
38
|
}
|
|
33
39
|
});
|
|
@@ -76,11 +82,6 @@ module.exports = {
|
|
|
76
82
|
beforeFind: async function () {
|
|
77
83
|
delete this.query.fields;
|
|
78
84
|
},
|
|
79
|
-
|
|
80
|
-
beforeAggregate: async function () {
|
|
81
|
-
delete this.query.fields;
|
|
82
|
-
},
|
|
83
|
-
|
|
84
85
|
afterFind: async function(){
|
|
85
86
|
const { spaceId } = this;
|
|
86
87
|
let dataList = await getInternalPermissionObjects();
|
|
@@ -121,25 +122,10 @@ module.exports = {
|
|
|
121
122
|
}
|
|
122
123
|
}
|
|
123
124
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
if (!_.isEmpty(dataList)) {
|
|
129
|
-
dataList.forEach((doc) => {
|
|
130
|
-
if (!_.find(this.data.values, (value) => {
|
|
131
|
-
return value.name === doc.name
|
|
132
|
-
})) {
|
|
133
|
-
this.data.values.push(doc);
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
const records = objectql.getSteedosSchema().metadataDriver.find(this.data.values, this.query, spaceId);
|
|
137
|
-
if (records.length > 0) {
|
|
138
|
-
this.data.values = records;
|
|
139
|
-
} else {
|
|
140
|
-
this.data.values.length = 0;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
125
|
+
_.each(this.data.values, (value)=>{
|
|
126
|
+
value.allowCreateListViews = value.allowCreateListViews == false ? false : true
|
|
127
|
+
})
|
|
128
|
+
|
|
143
129
|
},
|
|
144
130
|
afterCount: async function(){
|
|
145
131
|
delete this.query.fields;
|
|
@@ -153,6 +139,9 @@ module.exports = {
|
|
|
153
139
|
this.data.values = _.find(all, function(item){
|
|
154
140
|
return item._id === id
|
|
155
141
|
});
|
|
142
|
+
}else{
|
|
143
|
+
const { allowCreateListViews } = this.data.values;
|
|
144
|
+
this.data.values.allowCreateListViews = allowCreateListViews == false ? false : true
|
|
156
145
|
}
|
|
157
146
|
},
|
|
158
147
|
beforeInsert: async function(){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-permission",
|
|
3
|
-
"version": "2.5.11-beta.
|
|
3
|
+
"version": "2.5.11-beta.11",
|
|
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": "4749730d53a03f3cf27dd46528e6fe0a7bbb5a34"
|
|
16
16
|
}
|