From c95fcd6fbda5907cb7c79dd9d1b6dcf0842177bf Mon Sep 17 00:00:00 2001 From: yuri Date: Mon, 1 Jul 2019 16:31:02 +0300 Subject: [PATCH] action configCheck --- client/src/views/main.js | 3 +++ client/src/views/record/panels-container.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/client/src/views/main.js b/client/src/views/main.js index ceb8037bb5..f56c331d7f 100644 --- a/client/src/views/main.js +++ b/client/src/views/main.js @@ -88,6 +88,9 @@ define('views/main', 'view', function (Dep) { ['buttons', 'actions', 'dropdown'].forEach(function (type) { (this.menu[type] || []).forEach(function (item) { menu[type] = menu[type] || []; + if (item.configCheck) { + if (!this.getConfig().getByPath(item.configCheck.split('.'))) return; + } if (Espo.Utils.checkActionAccess(this.getAcl(), this.model || this.scope, item)) { menu[type].push(item); } diff --git a/client/src/views/record/panels-container.js b/client/src/views/record/panels-container.js index 9bc21d1cd8..6ebb4b510e 100644 --- a/client/src/views/record/panels-container.js +++ b/client/src/views/record/panels-container.js @@ -82,6 +82,12 @@ define('views/record/panels-container', 'view', function (Dep) { applyAccessToActions: function (actionList) { if (!actionList) return; actionList.forEach(function (item) { + if (item.configCheck) { + if (!this.getConfig().getByPath(item.configCheck.split('.'))) { + item.hidden = true; + return; + } + } if (Espo.Utils.checkActionAccess(this.getAcl(), this.model, item, true)) { if (item.isHiddenByAcl) { item.isHiddenByAcl = false;