action configCheck
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user