diff --git a/front/core/services/acl-service.js b/front/core/services/acl-service.js index dbba23884..6c3c6b1a7 100644 --- a/front/core/services/acl-service.js +++ b/front/core/services/acl-service.js @@ -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) {