@steedos/standard-permission 2.5.3-beta.9 → 2.5.5-beta.1
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 +2 -2
- package/main/default/objects/permission_set/buttons/permission_set.action.js +3 -1
- package/main/default/objects/permission_set/permission_set.object.yml +1 -1
- package/main/default/objects/permission_tabs/permissions/customer.permission.yml +3 -3
- package/main/default/routes/copyProfile.router.js +5 -5
- package/main/default/triggers/permission_objects.trigger.js +1 -1
- package/package.json +2 -2
|
@@ -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
|
}
|
|
@@ -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-18 12:55:43
|
|
6
6
|
* @Description: 复制已有简档来创建新简档
|
|
7
7
|
* 使用mongodb的事务处理,保证数据的一致性
|
|
8
8
|
* 复制对象包括:简档、对象权限、字段权限、选项卡权限
|
|
@@ -53,7 +53,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
|
|
|
53
53
|
throw new Error("permission_set is not profile type");
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
const { name:originalPermissionSetName } = originalPermissionSet;
|
|
56
|
+
const { name: originalPermissionSetName } = originalPermissionSet;
|
|
57
57
|
|
|
58
58
|
// API名称不能重复
|
|
59
59
|
const existPermissionSetCount = await psObj.count({
|
|
@@ -83,7 +83,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
|
|
|
83
83
|
const permissionSetColl = db.collection('permission_set');
|
|
84
84
|
|
|
85
85
|
// Start a transaction
|
|
86
|
-
session.startTransaction({ readConcern: { level: "
|
|
86
|
+
session.startTransaction({ readConcern: { level: "majority" }, writeConcern: { w: "majority" }, readPreference: 'primary' });
|
|
87
87
|
|
|
88
88
|
let newPermissionSet = null;
|
|
89
89
|
|
|
@@ -113,7 +113,7 @@ router.post('/api/permission/permission_set/copy', core.requireAuthentication, a
|
|
|
113
113
|
};
|
|
114
114
|
|
|
115
115
|
delete newPermissionSetData.record_permissions;
|
|
116
|
-
const insertPermissionSetResult = await permissionSetColl.insertOne(newPermissionSetData);
|
|
116
|
+
const insertPermissionSetResult = await permissionSetColl.insertOne(newPermissionSetData, { session });
|
|
117
117
|
newPermissionSet = insertPermissionSetResult.ops[0];
|
|
118
118
|
// console.log('newPermissionSet', newPermissionSet)
|
|
119
119
|
|
|
@@ -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
|
|
|
@@ -105,7 +105,7 @@ module.exports = {
|
|
|
105
105
|
filters: [
|
|
106
106
|
['_id', '=', permissionSetId],
|
|
107
107
|
]
|
|
108
|
-
})[0]
|
|
108
|
+
}))[0];
|
|
109
109
|
if (permissionSetDoc) {
|
|
110
110
|
// 替换this.query.filters中全部的的permission_set_id为permissionSetDoc.name
|
|
111
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}')`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-permission",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.5-beta.1",
|
|
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": "2d9b97fbe49148c4440eaf3d127e3344f10caede"
|
|
16
16
|
}
|