refs #4074 @1h add method to retrieve a object containing all the roles
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
3c2981953d
commit
db7fc594c8
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue