Hide Modules from the Module List
scott to work on an example.
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
({
extendsFrom: 'ModuleListLayout',
initialize: function(options) {
this._super('initialize', [options])
},
/**
* Adds all default menu views as components in both full and short
* version.
*
* This will set the menu as sticky to differentiate from the others that
* are added based on navigation/reference only.
*
* @private
*/
_addDefaultMenus: function() {
var moduleList = app.metadata.getModuleNames({filter: 'display_tab', access: 'read'})
if (app.user.get('type') !== 'admin'){
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
({
/**
* @copyright: redk - Get further, together
* @author: Maria Samuels maria.samuels@redk.net
* @jira: FIDSUPP-118
*/
extendsFrom: 'ModuleMenuView',
/**
* Filters menu actions by ACLs for the current user.
*
* @param {Array} meta The menu metadata to check access.
* @return {Array} Returns only the list of actions the user has access.
*/
filterByAccess: function (meta) {
var result = this._super('filterByAccess', [meta]);
var spliceIdx = null;
_.each(result, function (menuItem, idx) {
if (menuItem.acl_action === 'product-massupdate'
&& app.user.get('type') !== 'admin'