From 39c3eeadd83df202e1bb1badfb7fe75135aa04ed Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 10 Nov 2022 09:21:11 +0200 Subject: [PATCH] ref --- .../src/views/preferences/fields/tab-list.js | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/client/src/views/preferences/fields/tab-list.js b/client/src/views/preferences/fields/tab-list.js index a49b74be83..7fd1a97e94 100644 --- a/client/src/views/preferences/fields/tab-list.js +++ b/client/src/views/preferences/fields/tab-list.js @@ -26,30 +26,40 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -define('views/preferences/fields/tab-list', 'views/settings/fields/tab-list', function (Dep) { +define('views/preferences/fields/tab-list', ['views/settings/fields/tab-list'], function (Dep) { return Dep.extend({ setup: function () { Dep.prototype.setup.call(this); - this.params.options = this.params.options.filter(function (scope) { - if (scope === '_delimiter_' || scope === 'Home') return true; - var defs = this.getMetadata().get(['scopes', scope]); - if (!defs) return; + this.params.options = this.params.options.filter(scope => { + if (scope === '_delimiter_' || scope === 'Home') { + return true; + } - if (defs.disabled) return; + let defs = this.getMetadata().get(['scopes', scope]); + + if (!defs) { + return; + } + + if (defs.disabled) { + return; + } if (defs.acl) { return this.getAcl().check(scope); } + if (defs.tabAclPermission) { - var level = this.getAcl().get(defs.tabAclPermission); + let level = this.getAcl().get(defs.tabAclPermission); + return level && level !== 'no'; } - return true; - }, this); - }, + return true; + }); + }, }); });