This commit is contained in:
Yuri Kuznetsov
2022-11-10 09:21:11 +02:00
parent 429d808e98
commit 39c3eeadd8
+20 -10
View File
@@ -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;
});
},
});
});