@steedos/standard-permission 2.5.11-beta.1 → 2.5.11-beta.10

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.
@@ -102,6 +102,8 @@ fields:
102
102
  label: System
103
103
  help:
104
104
  description:
105
+ allowCreateListViews:
106
+ label: Allow Create ListViews
105
107
  groups:
106
108
  files_permissions: Files permissions
107
109
  listviews:
@@ -94,6 +94,8 @@ fields:
94
94
  label: 系统
95
95
  help:
96
96
  description:
97
+ allowCreateListViews:
98
+ label: 允许创建试图
97
99
  groups:
98
100
  files_permissions: 附件权限
99
101
  listviews:
@@ -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, record) {
165
- return true;
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, {_id: `${code}_${objectName}`, name: `${code}_${objectName}`, permission_set_id: code, object_name: objectName}, baseRecord))
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
- afterAggregate: async function(){
126
- const { spaceId } = this;
127
- let dataList = await getInternalPermissionObjects();
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.1",
3
+ "version": "2.5.11-beta.10",
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": "502a8f82483090bba5ef9c6b41169affbf299981"
15
+ "gitHead": "15896005ccd3119b38ed36350900d28fd6e75e35"
16
16
  }