update user roles looks to work :-)

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1230556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-01-12 14:12:44 +00:00
parent 4812edab08
commit 173bb19544
2 changed files with 19 additions and 2 deletions

View File

@ -202,6 +202,24 @@ $(function() {
}
}
this.updateAssignedRoles=function(){
$.log("user#updateAssignedRoles");
var curUser = this;
$.ajax("restServices/redbackServices/roleManagementService/updateUserRoles", {
data: "{\"user\": " + ko.toJSON(this)+"}",
contentType: 'application/json',
type: "POST",
dataType: 'json',
success: function(result) {
displaySuccessMessage($.i18n.prop("user.roles.updated",curUser.username()));
},
error: function(result) {
var obj = jQuery.parseJSON(result.responseText);
displayRedbackError(obj);
}
});
}
this.i18n = $.i18n.prop;
}

View File

@ -206,8 +206,7 @@ $(function() {
this.applicationRoles = ko.observableArray(new Array());
updateUserRoles=function(){
$.log("updateUserRoles assigned:"+this.user.assignedRoles().length);
this.user.updateAssignedRoles();
}
}