Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Code from mleanos
Browse files Browse the repository at this point in the history
  • Loading branch information
codydaig committed Aug 14, 2015
1 parent e68b422 commit 9fc6091
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 2 additions & 1 deletion modules/articles/client/config/articles.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ angular.module('articles').run(['Menus',
Menus.addMenuItem('topbar', {
title: 'Articles',
state: 'articles',
type: 'dropdown'
type: 'dropdown',
roles: ['*']
});

// Add the dropdown list item
Expand Down
3 changes: 1 addition & 2 deletions modules/chat/client/config/chat.client.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ angular.module('chat').run(['Menus',
// Set top bar menu items
Menus.addMenuItem('topbar', {
title: 'Chat',
state: 'chat',
roles: ['user']
state: 'chat'
});
}
]);
8 changes: 5 additions & 3 deletions modules/core/client/services/menus.client.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
angular.module('core').service('Menus', [
function () {
// Define a set of default roles
this.defaultRoles = ['*'];
this.defaultRoles = ['user', 'admin'];

// Define the menus object
this.menus = {};
Expand Down Expand Up @@ -87,7 +87,7 @@ angular.module('core').service('Menus', [
state: options.state || '',
type: options.type || 'item',
class: options.class,
roles: ((options.roles === null || typeof options.roles === 'undefined') ? this.menus[menuId].roles : options.roles),
roles: ((options.roles === null || typeof options.roles === 'undefined') ? this.defaultRoles : options.roles),
position: options.position || 0,
items: [],
shouldRender: shouldRender
Expand Down Expand Up @@ -164,6 +164,8 @@ angular.module('core').service('Menus', [
};

//Adding the topbar menu
this.addMenu('topbar');
this.addMenu('topbar', {
roles: ['*']
});
}
]);

0 comments on commit 9fc6091

Please sign in to comment.