Skip to content

Commit

Permalink
Merge pull request meanjs#1100 from mleanos/bugfix/ClientRoutes-Guest…
Browse files Browse the repository at this point in the history
…-Access

fix(core): Client routes guest access bug
  • Loading branch information
codydaig committed Dec 31, 2015
2 parents a89d82f + bfcfb55 commit 169d4cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/core/client/app/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(function ($ro
if (toState.data && toState.data.roles && toState.data.roles.length > 0) {
var allowed = false;
toState.data.roles.forEach(function (role) {
if (Authentication.user.roles !== undefined && Authentication.user.roles.indexOf(role) !== -1) {
if ((role === 'guest') || (Authentication.user && Authentication.user.roles !== undefined && Authentication.user.roles.indexOf(role) !== -1)) {
allowed = true;
return true;
}
Expand Down

0 comments on commit 169d4cd

Please sign in to comment.