Skip to content

Commit

Permalink
cleanup authenticated and added check for enabled moduler
Browse files Browse the repository at this point in the history
  • Loading branch information
ellman committed May 7, 2014
1 parent 60569f3 commit d7034dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions server/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ exports.render = function(req, res) {
angularDependencies: mean.modules[name].angularDependencies
});
}

// Send some basic starting info to the view
res.render('index', {
user: req.user ? {
Expand All @@ -24,8 +24,8 @@ exports.render = function(req, res) {
roles: req.user.roles
} : {},
modules: modules,
enabledAdmin: function(name) {
return (req.user.roles && req.user.roles.indexOf('admin') && mean.enabled(name));
adminEnabled: function() {
return (req.user && (req.user.roles.indexOf('admin') != -1) && mean.enabled('mean-admin'));
}

});
Expand Down
2 changes: 1 addition & 1 deletion server/views/layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<body>
<div class="navbar navbar-inverse navbar-fixed-top" data-ng-include="'/public/system/views/header.html'" data-role="navigation"></div>
{% if enabledAdmin('mean-admin') %}
{% if adminEnabled() %}
<section class="admin-menu">
<div data-ng-include="'/mean-admin/views/index.html'"></div>
</section>
Expand Down

0 comments on commit d7034dd

Please sign in to comment.