Skip to content

EspoCRM – Open Source CRM Application

Field level aclDisabled param

Yurii0e2fc1212027
diff --git a/application/Espo/Resources/metadata/entityDefs/Email.json b/application/Espo/Resources/metadata/entityDefs/Email.json
index cfbfc1d5d5..895e57c273 100644
--- a/application/Espo/Resources/metadata/entityDefs/Email.json
+++ b/application/Espo/Resources/metadata/entityDefs/Email.json
@@ -402,7 +402,8 @@
"type": "attachmentMultiple",
"sourceList": ["Document"],
"layoutDefaultSidePanelDisabled": true,
- "massUpdateDisabled": true
+ "massUpdateDisabled": true,
+ "aclDisabled": true
},
"hasAttachment": {
"type": "bool",
diff --git a/client/src/views/role/modals/add-field.js b/client/src/views/role/modals/add-field.js
index b88a8c9630..76cfd32e4d 100644
--- a/client/src/views/role/modals/add-field.js
+++ b/client/src/views/role/modals/add-field.js
@@ -95,6 +95,7 @@ class RoleAddFieldModalView extends ModalView {
this.headerText = this.translate(scope, 'scopeNamesPlural') + ' · ' + this.translate('Add Field');
+ /** @type {Record<string, Record>} */
const fields = this.getMetadata().get(`entityDefs.${scope}.fields`) || {};
const fieldList = [];
@@ -105,6 +106,10 @@ class RoleAddFieldModalView extends ModalView {
return;
}
+ if (fields[field].aclDisabled) {
+ return;
+ }
+
const mandatoryLevel = this.getMetadata()
.get(['app', this.options.type, 'mandatory', 'scopeFieldLevel', this.scope, field]);
diff --git a/client/src/views/role/record/table.js b/client/src/views/role/record/table.js
index 0ba5d8975f..81933d49e8 100644
--- a/client/src/views/role/record/table.js
+++ b/client/src/views/role/record/table.js
@@ -690,6 +690,13 @@ class RoleRecordTableView extends View {
return;
}
+ /** @type {Record} */
+ const fieldDefs = this.getMetadata().get(`entityDefs.${scope}.fields.${field}`) ?? {};
+
+ if (fieldDefs.aclDisabled) {
+ return;
+ }
+
const list = [];
this.fieldActionList.forEach(action => {
diff --git a/schema/metadata/entityDefs.json b/schema/metadata/entityDefs.json
index ba70eef052..728ea57809 100644
--- a/schema/metadata/entityDefs.json
+++ b/schema/metadata/entityDefs.json
@@ -1270,6 +1270,10 @@
"type": "boolean",
"description": "Disables the ability perform mass-update on the field. As of v8.4."
},
+ "aclDisabled": {
+ "type": "boolean",
+ "description": "Disables field-level ACL for the field. As of v10.1."
+ },
"apiSpecDisabled": {
"type": "boolean",
"description": "Do not print the field in the API specification. As of v9.3."