added updating roles

This commit is contained in:
hydrabolt
2015-10-26 13:29:01 +00:00
parent a3b2f9c2d4
commit 08ffd473e4
5 changed files with 113 additions and 49 deletions

View File

@@ -75,11 +75,11 @@ class Server {
getRole(id){
for (var role of this.roles) {
if (role.id === id) {
if (role.id == id) {
return role;
}
}
return null;
}
@@ -96,15 +96,13 @@ class Server {
}
updateRole(data){
var oldRole = this.getRole(data.id);
if(oldRole){
var index = this.roles.indexOf(oldRole);
this.roles[index] = new ServerPermissions(data);
return this.roles[index];
}else{