Refactored menus.client.service.js
This commit is contained in:
parent
8122044a51
commit
b494b50ed5
|
@ -15,22 +15,18 @@ angular.module('core').service('Menus', [
|
||||||
if (user) {
|
if (user) {
|
||||||
if (~this.roles.indexOf('*')) {
|
if (~this.roles.indexOf('*')) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
}
|
||||||
for (var userRoleIndex in user.roles) {
|
for (var userRoleIndex in user.roles) {
|
||||||
for (var roleIndex in this.roles) {
|
for (var roleIndex in this.roles) {
|
||||||
console.log(this.roles[roleIndex]);
|
if (this.roles[roleIndex] === user.roles[userRoleIndex]) {
|
||||||
console.log( this.roles[roleIndex] === user.roles[userRoleIndex]);
|
return true;
|
||||||
if (this.roles[roleIndex] === user.roles[userRoleIndex]) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
return false;
|
||||||
return this.isPublic;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
}
|
||||||
|
return this.isPublic;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Validate menu existance
|
// Validate menu existance
|
||||||
|
|
Loading…
Reference in a new issue