@steedos/standard-permission 3.0.0-beta.99 → 3.0.0

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.
@@ -118,3 +118,6 @@ actions:
118
118
  label: Customize
119
119
  resetFieldPermissions:
120
120
  label: ResetFieldPermissions
121
+ CustomLabels:
122
+ permission_objects_actions_resetFieldPermissions_success: The field permission initialization was successful
123
+ permission_objects_actions_resetFieldPermissions_failed: The field permission initialization was failed
@@ -110,3 +110,6 @@ listviews:
110
110
  actions:
111
111
  customize:
112
112
  label: 自定义
113
+ CustomLabels:
114
+ permission_objects_actions_resetFieldPermissions_success: 字段权限初始化成功
115
+ permission_objects_actions_resetFieldPermissions_failed: 字段权限初始化失败
@@ -1,5 +1,5 @@
1
1
  name: permission_set
2
- label: Profile & Permission Set
2
+ label: Permission Sets
3
3
  description:
4
4
  fields:
5
5
  name:
@@ -0,0 +1,57 @@
1
+ name: resetFieldPermissions
2
+ label: ResetFieldPermissions
3
+ 'on': record_only
4
+ type: amis_button
5
+ amis_schema: |-
6
+ {
7
+ "type": "service",
8
+ "body": [
9
+ {
10
+ "type": "button",
11
+ "label": "${'CustomAction.permission_objects.resetFieldPermissions' | t}",
12
+ "id": "u:resetFieldPermissions",
13
+ "onEvent": {
14
+ "click": {
15
+ "weight": 0,
16
+ "actions": [
17
+ {
18
+ "actionType": "ajax",
19
+ "api": {
20
+ "url": "/api/permission/permission_objects/resetFieldPermissions",
21
+ "method": "post",
22
+ "requestAdaptor": "api.data={permissionObjectId: context.recordId}\n\n\nreturn api;",
23
+ "adaptor": "return payload.success ? {data: {...payload}, status: 0, msg: t('CustomLabels.permission_objects_actions_resetFieldPermissions_success')} : {...payload, status: 1, msg: t('CustomLabels.permission_objects_actions_resetFieldPermissions_failed')};"
24
+ }
25
+ },
26
+ {
27
+ "actionType": "broadcast",
28
+ "args": {
29
+ "eventName": "@data.changed.permission_objects"
30
+ },
31
+ "data": {
32
+ "objectName": "permission_objects",
33
+ "displayAs": "${displayAs}"
34
+ }
35
+ },
36
+ {
37
+ "actionType": "broadcast",
38
+ "args": {
39
+ "eventName": "@data.changed.permission_fields"
40
+ },
41
+ "data": {
42
+ "objectName": "permission_fields",
43
+ "displayAs": "${displayAs}"
44
+ }
45
+ }
46
+ ]
47
+ }
48
+ }
49
+ }
50
+ ],
51
+ "regions": [
52
+ "body"
53
+ ],
54
+ "bodyClassName": "p-0",
55
+ "id": "u:6d7a34bd662e",
56
+ "dsType": "api"
57
+ }
@@ -2,20 +2,20 @@
2
2
  * @Author: 殷亮辉 yinlianghui@hotoa.com
3
3
  * @Date: 2025-07-07 16:57:38
4
4
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
- * @LastEditTime: 2025-08-11 14:55:44
5
+ * @LastEditTime: 2025-10-28 10:09:35
6
6
  */
7
7
  const _ = require("underscore");
8
8
  module.exports = {
9
- resetFieldPermissions: function (object_name, record_id) {
10
- var doc = Creator.odata.get(object_name, record_id);
11
- var result = Steedos.authRequest(`/api/v4/${object_name}/${record_id}/resetFieldPermissions`, { type: 'get', async: false });
12
- if (result.error) {
13
- toastr.error(t(result.error));
14
- } else {
15
- toastr.success('初始化成功', '字段权限');
16
- FlowRouter.reload();
17
- }
18
- },
9
+ // resetFieldPermissions: function (object_name, record_id) {
10
+ // var doc = Creator.odata.get(object_name, record_id);
11
+ // var result = Steedos.authRequest(`/api/v4/${object_name}/${record_id}/resetFieldPermissions`, { type: 'get', async: false });
12
+ // if (result.error) {
13
+ // toastr.error(t(result.error));
14
+ // } else {
15
+ // toastr.success('初始化成功', '字段权限');
16
+ // FlowRouter.reload();
17
+ // }
18
+ // },
19
19
  resetFieldPermissionsVisible: function (object_name, record_id, record_permissions, data) {
20
20
  var record = data && data.record;
21
21
  if (!record) {
@@ -58,10 +58,6 @@ fields:
58
58
  # readonly: true 不可以设置为只读,新建编辑表单需要加载这个字段值
59
59
  visible_on: "${false}"
60
60
  inlineHelpText: "版本号,用于记录规则更新,比如版本>=2时,record_filter 显示为amis过滤器"
61
- actions:
62
- customize:
63
- label: 自定义
64
- on: record
65
61
  list_views:
66
62
  all:
67
63
  label: 所有
@@ -61,10 +61,6 @@ fields:
61
61
  # readonly: true 不可以设置为只读,新建编辑表单需要加载这个字段值
62
62
  visible_on: "${false}"
63
63
  inlineHelpText: "版本号,用于记录规则更新,比如版本>=2时,record_filter 显示为amis过滤器"
64
- actions:
65
- customize:
66
- label: 自定义
67
- on: record
68
64
  list_views:
69
65
  all:
70
66
  label: 所有
@@ -0,0 +1,35 @@
1
+ /*
2
+ * @Author: 殷亮辉 yinlianghui@hotoa.com
3
+ * @Date: 2025-10-27 22:42:00
4
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5
+ * @LastEditTime: 2025-10-28 10:14:50
6
+ */
7
+ 'use strict';
8
+
9
+ const express = require("express");
10
+ const router = express.Router();
11
+ const auth = require('@steedos/auth');
12
+ const objectql = require('@steedos/objectql');
13
+ const _ = require('underscore');
14
+
15
+ router.post('/api/permission/permission_objects/resetFieldPermissions', auth.requireAuthentication, async function (req, res) {
16
+ try {
17
+ const { params, user: userSession } = req;
18
+ // const recordId = params.permissionObjectId;
19
+ const { permissionObjectId: recordId } = req.body;
20
+ await objectql.getSteedosSchema().broker.call(`permission_fields.resetFieldPermissions`, {
21
+ permissionObjectId: recordId
22
+ }, {
23
+ meta: {
24
+ user: userSession
25
+ }
26
+ });
27
+ res.status(200).send({success: true});
28
+ } catch (error) {
29
+ console.error(error);
30
+ res.status(400).send({
31
+ error: error.message
32
+ });
33
+ }
34
+ });
35
+ exports.default = router;
package/package.json CHANGED
@@ -1,8 +1,7 @@
1
1
  {
2
2
  "name": "@steedos/standard-permission",
3
- "version": "3.0.0-beta.99",
3
+ "version": "3.0.0",
4
4
  "main": "package.service.js",
5
- "private": false,
6
5
  "publishConfig": {
7
6
  "access": "public"
8
7
  },
@@ -12,7 +11,7 @@
12
11
  "description": "steedos package",
13
12
  "repository": {},
14
13
  "license": "MIT",
15
- "gitHead": "a0e9d5ee78766e54048a385b7677f6916aa287c4",
14
+ "gitHead": "20ea485d800dd4ad0a99c82b26000879c2f85741",
16
15
  "dependencies": {
17
16
  "clone": "^2.1.2"
18
17
  }
@@ -30,7 +30,7 @@ module.exports = {
30
30
  /**
31
31
  * Dependencies
32
32
  */
33
- dependencies: ['~packages-standard-objects'],
33
+ dependencies: ['@steedos/standard-objects'],
34
34
 
35
35
  /**
36
36
  * Actions
@@ -1,23 +0,0 @@
1
- const objectql = require("@steedos/objectql");
2
-
3
- module.exports = {
4
- resetFieldPermissions: async function (req, res) {
5
- try {
6
- const { params, user: userSession } = req;
7
- const recordId = params._id;
8
- await objectql.getSteedosSchema().broker.call(`permission_fields.resetFieldPermissions`, {
9
- permissionObjectId: recordId
10
- }, {
11
- meta: {
12
- user: userSession
13
- }
14
- });
15
- res.status(200).send({});
16
- } catch (error) {
17
- console.error(error);
18
- res.status(400).send({
19
- error: error.message
20
- });
21
- }
22
- }
23
- }
@@ -1,114 +0,0 @@
1
- name: copy
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "${'permission_set.copy.copy' | t}",
9
- "id": "u:copy",
10
- "onEvent": {
11
- "click": {
12
- "weight": 0,
13
- "actions": [
14
- {
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "${'permission_set.copy.copy_record' | t}",
18
- "body": [
19
- {
20
- "type": "form",
21
- "title": "表单",
22
- "body": [
23
- {
24
- "label": "${'permission_set.copy.display_name' | t}",
25
- "type": "input-text",
26
- "value": "${'permission_set.copy.copy_of_record' | t:${record.label}}",
27
- "name": "label_input",
28
- "id": "u:24e89a11d437",
29
- "required": true
30
- },
31
- {
32
- "type": "input-text",
33
- "name": "name_input",
34
- "value": "${record.name}_copy",
35
- "label": "${'permission_set.copy.api_name' | t}",
36
- "id": "u:27bd7cfe3e12",
37
- "required": true
38
- }
39
- ],
40
- "api": {
41
- "url": "${context.rootUrl}/api/permission/permission_set/copy",
42
- "method": "post",
43
- "messages": {
44
- "success": "复制成功"
45
- },
46
- "requestAdaptor": "delete api.body.label_input;\ndelete api.body.name_input;",
47
- "data": {
48
- "&": "$$",
49
- "label": "${label_input}",
50
- "name": "${name_input}",
51
- "originalPermissionSetId": "${record._id}"
52
- },
53
- "headers": {
54
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
55
- }
56
- },
57
- "onEvent": {
58
- "submitSucc": {
59
- "weight": 0,
60
- "actions": [
61
- {
62
- "args": {
63
- "url": "${context.rootUrl}/app/${appId}/${objectName}/view/${result.data.recordId}",
64
- "blank": false
65
- },
66
- "actionType": "url"
67
- }
68
- ]
69
- }
70
- },
71
- "id": "u:818f7b68417b",
72
- "mode": "normal"
73
- }
74
- ],
75
- "showCloseButton": true,
76
- "showErrorMsg": true,
77
- "showLoading": true,
78
- "id": "u:9f9b042404a1",
79
- "closeOnEsc": false,
80
- "dataMapSwitch": false,
81
- "size": "md"
82
- },
83
- "actionType": "dialog"
84
- }
85
- ]
86
- }
87
- }
88
- }
89
- ],
90
- "regions": [
91
- "body"
92
- ],
93
- "data": {
94
- "context": {},
95
- "app_id": "",
96
- "tab_id": "",
97
- "object_name": "",
98
- "dataComponentId": "",
99
- "record_id": "",
100
- "record": {},
101
- "permissions": {}
102
- },
103
- "bodyClassName": "p-0",
104
- "id": "u:4b81eda72f12"
105
- }
106
- is_enable: true
107
- label: 复制
108
- 'on': record_only
109
- type: amis_button
110
- visible: !!js/function |
111
- function (object_name, record_id, record_permissions, record) {
112
-
113
- return record.record.type == 'profile';
114
- }
@@ -1,166 +0,0 @@
1
- name: set_permission_tabs
2
- amis_schema: |-
3
- {
4
- "type": "service",
5
- "body": [
6
- {
7
- "type": "button",
8
- "label": "${'permission_set.set_permission_tabs.set_permission' | t}",
9
- "id": "u:set_permission_tabs",
10
- "onEvent": {
11
- "click": {
12
- "actions": [
13
- {
14
- "actionType": "dialog",
15
- "dialog": {
16
- "type": "dialog",
17
- "title": "${'permission_set.set_permission_tabs.set_permission' | t}",
18
- "body": [
19
- {
20
- "type": "form",
21
- "id": "u:2281889ba1e7",
22
- "body": [
23
- {
24
- "type": "input-table",
25
- "id": "u:1516aff9070c",
26
- "name": "permission_tabs_list",
27
- "label": "",
28
- "columns": [
29
- {
30
- "label": "${'permission_set.set_permission_tabs.tab' | t}",
31
- "name": "tab.label",
32
- "type": "text",
33
- "id": "u:ebd95b18057a",
34
- "placeholder": "-"
35
- },
36
- {
37
- "label": "${'permission_set.set_permission_tabs.permission' | t}",
38
- "name": "permission",
39
- "type": "select",
40
- "id": "u:ad5dcb76754f",
41
- "options": [
42
- {
43
- "label": "默认打开",
44
- "value": "on"
45
- },
46
- {
47
- "label": "默认关闭",
48
- "value": "off"
49
- }
50
- ],
51
- "value": "on"
52
- }
53
- ],
54
- "strictMode": true,
55
- "disabled": false,
56
- "mode": "normal"
57
- }
58
- ],
59
- "messages": {},
60
- "initApi": {
61
- "method": "post",
62
- "url": "${context.rootUrl}/graphql",
63
- "data": {
64
- "&": "$$",
65
- "record": "${record}"
66
- },
67
- "adaptor": "const data = payload.data\nconst { permission_tabs, tabs } = data\nconst tableOptions = []\nconst tabNames = [] // 用于存储已经遍历过的选项卡,防止重复\nfor (const pTab of permission_tabs) {\n tableOptions.push({\n tab: {\n _id: pTab.tab__expand?._id,\n name: pTab.tab__expand?.name,\n label: pTab.tab__expand?.label\n },\n permission: pTab.permission\n })\n tabNames.push(pTab.tab__expand?.name)\n}\n\nfor (const tab of tabs) {\n if (tabNames.includes(tab.name)) {\n continue\n }\n tableOptions.push({\n tab: {\n _id: tab._id,\n name: tab.name,\n label: tab.label\n },\n permission: 'on'\n })\n}\n\ndata.permission_tabs_list = tableOptions\n\nreturn payload\n",
68
- "headers": {
69
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
70
- },
71
- "requestAdaptor": "const record = api.body.record\napi.data.query = `\n{\n permission_tabs(filters: [[\"permission_set\", \"=\", \"${record.name}\"]]) {\n _id\n permission\n tab__expand {\n _id\n name\n label\n }\n }\n tabs {\n _id\n name\n label\n }\n}\n`\ndelete api.body.record;\nreturn api;",
72
- "dataType": "json"
73
- },
74
- "api": {
75
- "method": "post",
76
- "url": "${context.rootUrl}/api/permission/permission_set/batchSavePermissionTabs",
77
- "data": {
78
- "&": "$$",
79
- "record": "${record}",
80
- "record_id": "${record_id}"
81
- },
82
- "requestAdaptor": "api.data.permission_set_name = api.data.record.name\ndelete api.data.permission_tabs\ndelete api.data.record\ndelete api.data.tabs\n\nreturn api",
83
- "dataType": "json"
84
- },
85
- "onEvent": {
86
- "submitSucc": {
87
- "weight": 0,
88
- "actions": [
89
- {
90
- "actionType": "custom",
91
- "script": "/* 自定义JS使用说明: \n * 1.动作执行函数doAction,可以执行所有类型的动作\n * 2.通过上下文对象context可以获取当前组件实例,例如context.props可以获取该组件相关属性\n * 3.事件对象event,在doAction之后执行event.stopPropagation = true;可以阻止后续动作执行\n*/\n\nSteedosUI.router.go({ objectName: 'permission_set', recordId: context.props.data.record_id, type: 'edit' });\n"
92
- }
93
- ]
94
- }
95
- }
96
- }
97
- ],
98
- "id": "u:5d6ebd078296",
99
- "closeOnEsc": false,
100
- "closeOnOutside": false,
101
- "showCloseButton": true,
102
- "data": null,
103
- "size": "lg",
104
- "actions": [
105
- {
106
- "type": "button",
107
- "label": "${'permission_set.set_permission_tabs.cancel' | t}",
108
- "onEvent": {
109
- "click": {
110
- "actions": [
111
- {
112
- "componentId": "",
113
- "args": {},
114
- "actionType": "closeDialog"
115
- }
116
- ]
117
- }
118
- },
119
- "id": "u:f1b8dabafee5",
120
- "level": "default"
121
- },
122
- {
123
- "type": "submit",
124
- "label": "${'permission_set.set_permission_tabs.save' | t}",
125
- "onEvent": {},
126
- "id": "u:246398c1f14c",
127
- "level": "primary",
128
- "close": true,
129
- "hidden": false
130
- }
131
- ]
132
- }
133
- }
134
- ],
135
- "weight": 0
136
- }
137
- },
138
- "level": "enhance"
139
- }
140
- ],
141
- "regions": [
142
- "body"
143
- ],
144
- "data": {
145
- "context": {
146
- "rootUrl": "http://127.0.0.1:5100"
147
- },
148
- "app_id": "",
149
- "tab_id": "",
150
- "object_name": "",
151
- "dataComponentId": "",
152
- "record_id": "",
153
- "record": {},
154
- "permissions": {}
155
- },
156
- "id": "u:ae64657bc500",
157
- "bodyClassName": "p-0"
158
- }
159
- is_enable: true
160
- label: 设置选项卡权限
161
- 'on': record_only
162
- type: amis_button
163
- visible: !!js/function |
164
- function (object_name, record_id, record_permissions, data) {
165
- return data.record.type === 'profile';
166
- }
@@ -1,240 +0,0 @@
1
- name: permission_set
2
- label: Profile & Permission Set
3
- icon: groups
4
- hidden: true
5
- enable_inline_edit: false
6
- version: 2
7
- enable_dataloader: false
8
- paging:
9
- enabled: false
10
- fields:
11
- name:
12
- label: Name
13
- type: text
14
- searchable: true
15
- index: true
16
- required: true
17
- label:
18
- label: Label
19
- type: text
20
- searchable: true
21
- index: true
22
- is_name: true
23
- required: true
24
- filterable: true
25
- type:
26
- label: Type
27
- type: select
28
- firstOption: false
29
- filterable: true
30
- options: Profile:profile,Permission set:permission_set
31
- defaultValue: permission_set
32
- amis:
33
- "disabledOn": "${global.mode !='read'}"
34
- assigned_apps:
35
- label: Assigned Apps
36
- type: lookup
37
- multiple: true
38
- reference_to: apps
39
- reference_to_field: code
40
- name: assigned_apps
41
- filterable: false
42
- is_wide: true
43
- default_standard_buttons:
44
- label: Default Standard Buttons
45
- type: select
46
- multiple: true
47
- options:
48
- - label: 查找
49
- value: standard_query
50
- - label: 新建
51
- value: standard_new
52
- - label: 查看
53
- value: standard_open_view
54
- - label: 编辑
55
- value: standard_edit
56
- - label: 删除
57
- value: standard_delete
58
- - label: 删除
59
- value: standard_delete_many
60
- - label: 发起审批
61
- value: standard_approve
62
- - label: 查看审批单
63
- value: standard_view_instance
64
- - label: 关注
65
- value: standard_follow
66
- - label: 提请批准
67
- value: standard_submit_for_approval
68
- - label: 导入数据
69
- value: standard_import_data
70
- visible_on: "{{'profile' === formData.type ? true: false}}"
71
- users:
72
- label: Users
73
- type: lookup
74
- reference_to: users
75
- multiple: true
76
- is_wide: true
77
- filterable: true
78
- inlineHelpText: When the type is a profile, no user needs to be selected
79
- visible_on: "{{'permission_set' === formData.type}}"
80
- is_system:
81
- type: boolean
82
- label: System
83
- # omit: true
84
- readonly: true
85
- visible_on: "{{global.mode ==='read' ? true : false}}"
86
- disabled: true
87
- password_history:
88
- type: lookup
89
- group: profile password policy
90
- showIcon: false
91
- label: 强制密码历史
92
- optionsFunction: !!js/function |
93
- function(){
94
- var options = [];
95
- //TODO 支持value = 0
96
- for(var i= 1; i < 25; i++){
97
- options.push({label: t('permission_set_field_password_history_options', i), value: `${i}`})
98
- }
99
- return options;
100
- }
101
- defaultValue: "3"
102
- visible_on: "{{'profile' === formData.type ? true: false}}"
103
- max_login_attempts:
104
- type: select
105
- label: 最大无效登录尝试次数
106
- group: profile password policy
107
- firstOption: false
108
- required: true
109
- options:
110
- - label: '3'
111
- value: '3'
112
- - label: '5'
113
- value: '5'
114
- - label: '10'
115
- value: '10'
116
- - label: '无限制'
117
- value: '0'
118
- defaultValue: "10"
119
- visible_on: "{{'profile' === formData.type ? true: false}}"
120
- lockout_interval:
121
- type: select
122
- group: profile password policy
123
- label: 锁定有效期间
124
- firstOption: false
125
- required: true
126
- options:
127
- - label: '15 分钟'
128
- value: '15'
129
- - label: '30 分钟'
130
- value: '30'
131
- - label: '60 分钟'
132
- value: '60'
133
- - label: '始终(必须由管理员重置)'
134
- value: '0'
135
- defaultValue: "15"
136
- visible_on: "{{'profile' === formData.type ? true: false}}"
137
- enable_MFA:
138
- type: boolean
139
- label: 多重身份验证(需要开启短信服务)
140
- inlineHelpText: 密码登陆的基础上增加短信验证的两种组合的鉴别技术进行系统登陆.
141
- sort_no: 1200
142
- group: login policy
143
- visible_on: "{{'profile' === formData.type ? true: false}}"
144
- logout_other_clients:
145
- type: boolean
146
- label: 单例登录
147
- inlineHelpText: 注销以当前用户身份登录的其他客户端。
148
- sort_no: 1100
149
- group: login policy
150
- visible_on: "{{'profile' === formData.type ? true: false}}"
151
- login_expiration_in_days:
152
- type: number
153
- scale: 4
154
- label: 登录到期时间(天)
155
- sort_no: 1000
156
- defaultValue: 90
157
- group: login policy
158
- visible_on: "{{'profile' === formData.type ? true: false}}"
159
- phone_logout_other_clients:
160
- type: boolean
161
- label: 手机App单例登录
162
- inlineHelpText: 注销以当前用户身份登录的其他客户端。
163
- sort_no: 1100
164
- group: login policy
165
- visible_on: "{{'profile' === formData.type ? true: false}}"
166
- phone_login_expiration_in_days:
167
- type: number
168
- scale: 4
169
- label: 手机App登录到期时间(天)
170
- sort_no: 1000
171
- defaultValue: 90
172
- group: login policy
173
- visible_on: "{{'profile' === formData.type ? true: false}}"
174
- list_views:
175
- all:
176
- label: All
177
- filter_scope: space
178
- columns:
179
- - label
180
- - name
181
- - users
182
- - type
183
- - license
184
- - is_system
185
- permission_set:
186
- label: Permission Set
187
- filter_scope: space
188
- filters:
189
- - [["type", "=", "permission_set"]]
190
- columns:
191
- - label
192
- - name
193
- - users
194
- - type
195
- - license
196
- - is_system
197
- profile:
198
- label: Profile
199
- filter_scope: space
200
- filters:
201
- - [["type", "=", "profile"]]
202
- columns:
203
- - label
204
- - name
205
- - type
206
- - license
207
- - is_system
208
- # relatedList:
209
- # - objectName: permission_objects
210
- # filters: !!js/function |
211
- # function(parentRecord) {
212
- # return [["is_system","=",true], ["permission_set_id","=",parentRecord._id]]
213
- # }
214
- # - objectName: permission_objects
215
- # filters: !!js/function |
216
- # function(parentRecord) {
217
- # return [["is_system","<>",true], ["permission_set_id","=",parentRecord._id]]
218
- # }
219
- permission_set:
220
- user:
221
- allowCreate: false
222
- allowDelete: false
223
- allowEdit: false
224
- allowRead: false
225
- modifyAllRecords: false
226
- viewAllRecords: false
227
- admin:
228
- allowCreate: true
229
- allowDelete: true
230
- allowEdit: true
231
- allowRead: true
232
- modifyAllRecords: true
233
- viewAllRecords: true
234
- customer:
235
- allowCreate: false
236
- allowDelete: false
237
- allowEdit: false
238
- allowRead: false
239
- modifyAllRecords: false
240
- viewAllRecords: false
@@ -1,26 +0,0 @@
1
- const _ = require("underscore");
2
- 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
- Creator.odata.insert(object_name, Object.assign(newDoc), function (result, error) {
14
- if (result) {
15
- FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
16
- }
17
- });
18
- },
19
- customizeVisible: function (object_name, record_id, record_permissions, data) {
20
- var record = data && data.record;
21
- if (!record) {
22
- record = {}
23
- }
24
- return Steedos.Object.base.actions.standard_new.visible() && record.is_system;
25
- }
26
- }
@@ -1,26 +0,0 @@
1
- const _ = require("underscore");
2
- 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
- Creator.odata.insert(object_name, Object.assign(newDoc), function (result, error) {
14
- if (result) {
15
- FlowRouter.go(`/app/-/${object_name}/view/${result._id}`)
16
- }
17
- });
18
- },
19
- customizeVisible: function (object_name, record_id, record_permissions, data) {
20
- var record = data && data.record;
21
- if (!record) {
22
- record = {}
23
- }
24
- return Steedos.Object.base.actions.standard_new.visible() && record.is_system;
25
- }
26
- }