@steedos/standard-permission 2.5.11-beta.7 → 2.5.11-beta.8

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
@@ -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.7",
3
+ "version": "2.5.11-beta.8",
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": "9330a1f7fd53ee2670ba21cb6f88c526ff000d2c"
15
+ "gitHead": "9abbe2ea0aa1c624500fa5111a8207f841a16f62"
16
16
  }