@steedos/standard-permission 3.0.0-beta.69 → 3.0.0-beta.70
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/objects/permission_objects.action.js +6 -39
- package/main/default/objects/permission_objects.object.yml +0 -3
- package/main/default/objects/permission_set/permission_set.object.yml +0 -4
- package/package.json +2 -2
- package/main/default/objects/permission_set/buttons/permission_set.action.js +0 -20
- package/main/default/objects/permission_tabs/buttons/customize.button.js +0 -31
- package/main/default/objects/permission_tabs/buttons/customize.button.yml +0 -4
|
@@ -1,44 +1,11 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
3
|
+
* @Date: 2025-07-07 16:57:38
|
|
4
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5
|
+
* @LastEditTime: 2025-08-11 14:55:44
|
|
6
|
+
*/
|
|
1
7
|
const _ = require("underscore");
|
|
2
8
|
module.exports = {
|
|
3
|
-
customize: function (object_name, record_id, fields) {
|
|
4
|
-
var doc = Creator.odata.get(object_name, record_id);
|
|
5
|
-
var newDoc = {}
|
|
6
|
-
_.each(Creator.getObject(object_name).fields, function(v, k){
|
|
7
|
-
if(_.has(doc, k)){
|
|
8
|
-
newDoc[k] = doc[k]
|
|
9
|
-
}
|
|
10
|
-
})
|
|
11
|
-
delete newDoc.is_system;
|
|
12
|
-
|
|
13
|
-
let permissionSetId = doc.permission_set_id
|
|
14
|
-
// if(_.includes(['admin','user','supplier','customer'], doc.permission_set_id)){
|
|
15
|
-
// let dbPst = Creator.odata.query('permission_set', {$select: "_id", $filter: "(name eq '"+doc.permission_set_id+"') and (space eq '"+Steedos.getSpaceId()+"')"}, true)
|
|
16
|
-
// if(dbPst && dbPst.length > 0){
|
|
17
|
-
// permissionSetId = dbPst[0]._id;
|
|
18
|
-
// }
|
|
19
|
-
|
|
20
|
-
// if(_.includes(['admin','user','supplier','customer'], permissionSetId)){
|
|
21
|
-
// return toastr.error("请先自定义权限集")
|
|
22
|
-
// }
|
|
23
|
-
// }
|
|
24
|
-
Creator.odata.insert(object_name, Object.assign(newDoc, {permission_set_id: permissionSetId}), function(result, error){
|
|
25
|
-
if (result) {
|
|
26
|
-
if(Session.get("object_name") === 'permission_objects'){
|
|
27
|
-
FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
28
|
-
}else{
|
|
29
|
-
href = Creator.getObjectUrl(object_name, result._id);
|
|
30
|
-
window.open(href,'_blank','width=800, height=600, left=50, top= 50, toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes')
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
},
|
|
35
|
-
customizeVisible: function(object_name, record_id, record_permissions, data){
|
|
36
|
-
var record = data && data.record;
|
|
37
|
-
if(!record){
|
|
38
|
-
record = {}
|
|
39
|
-
}
|
|
40
|
-
return Steedos.Object.base.actions.standard_new.visible() && record.is_system;
|
|
41
|
-
},
|
|
42
9
|
resetFieldPermissions: function (object_name, record_id) {
|
|
43
10
|
var doc = Creator.odata.get(object_name, record_id);
|
|
44
11
|
var result = Steedos.authRequest(`/api/v4/${object_name}/${record_id}/resetFieldPermissions`, { type: 'get', async: false });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/standard-permission",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.70",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"description": "steedos package",
|
|
13
13
|
"repository": {},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"gitHead": "
|
|
15
|
+
"gitHead": "597f124ef73efa97a2da52b4de3c7d733ebd6887",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"clone": "^2.1.2"
|
|
18
18
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
customize: function (object_name, record_id, fields) {
|
|
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,
|
|
5
|
-
default_standard_buttons: doc.default_standard_buttons
|
|
6
|
-
}, function(result, error){
|
|
7
|
-
if(result){
|
|
8
|
-
FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
customizeVisible: function(object_name, record_id, record_permissions, data){
|
|
14
|
-
var record = data && data.record;
|
|
15
|
-
if(!record){
|
|
16
|
-
record = {}
|
|
17
|
-
}
|
|
18
|
-
return Steedos.Object.base.actions.standard_new.visible() && record.is_system;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: sunhaolin@hotoa.com
|
|
3
|
-
* @Date: 2022-10-27 14:30:02
|
|
4
|
-
* @LastEditors: sunhaolin@hotoa.com
|
|
5
|
-
* @LastEditTime: 2022-10-27 14:46:17
|
|
6
|
-
* @Description:
|
|
7
|
-
*/
|
|
8
|
-
module.exports = {
|
|
9
|
-
customize: function (object_name, record_id, fields) {
|
|
10
|
-
var doc = Creator.odata.get(object_name, record_id);
|
|
11
|
-
var newDoc = {}
|
|
12
|
-
_.each(Creator.getObject(object_name).fields, function (v, k) {
|
|
13
|
-
if (_.has(doc, k)) {
|
|
14
|
-
newDoc[k] = doc[k]
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
delete newDoc.is_system;
|
|
18
|
-
|
|
19
|
-
Creator.odata.insert(object_name, Object.assign(newDoc), function (result, error) {
|
|
20
|
-
if (result) {
|
|
21
|
-
SteedosUI.reloadRecord(object_name, result._id);
|
|
22
|
-
FlowRouter.reload();
|
|
23
|
-
FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
},
|
|
27
|
-
customizeVisible: function (object_name, record_id, record_permissions, data) {
|
|
28
|
-
var record = data && data.record;
|
|
29
|
-
return record && Steedos.Object.base.actions.standard_new.visible() && record.is_system;
|
|
30
|
-
}
|
|
31
|
-
}
|