action configCheck

This commit is contained in:
yuri
2019-07-01 16:31:02 +03:00
parent e6009366e8
commit c95fcd6fbd
2 changed files with 9 additions and 0 deletions
+3
View File
@@ -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);
}
@@ -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;