fixes #4074 Descargar ACL del usuario actual #1255

Closed
pau wants to merge 40 commits from 4074-download-user-ACL into dev
1 changed files with 10 additions and 0 deletions
Showing only changes of commit db7fc594c8 - Show all commits

View File

@ -14,6 +14,12 @@ class AclService {
return this.$http.get('Accounts/acl').then(res => {
this.user = res.data.user;
this.roles = {};
this.rolesMap = {};
res.data.roles.forEach(role => {
if (role.role)
this.rolesMap[role.role.name] = true;
});
for (let role of res.data.roles) {
if (role.role)
this.roles[role.role.name] = true;
@ -21,6 +27,10 @@ class AclService {
});
}
returnRoles() {
return this.rolesMap;
}
hasAny(roles) {
if (this.roles) {
for (let role of roles) {