+ // LOAD CONCERNED USERS
+ var selectionModel = this.table.getSelectionModel();
+ if(!selectionModel.getSelectedCount()){
+ return;
+ }
+ var roleValue = this._selectionToValues(selectionModel)[0];
+
+ var users = deltaPlus.concat(deltaMinus);
+ var modal = new org.argeo.ria.components.Modal("Batch Update", "", "Please wait, updating roles for selected users");
+ modal.attachAndShow();
+ for(var i=0;i<users.length;i++){
+ var user = users[i];
+ var userDetailService = org.argeo.security.ria.SecurityAPI.getUserDetailsService(users[i]);
+ userDetailService.addListener("completed", function(response){
+ var userRoles = response.getContent().roles;
+ if(qx.lang.Array.contains(deltaPlus, user)){
+ userRoles.push(roleValue);
+ }else if(qx.lang.Array.contains(deltaMinus, user)){
+ qx.lang.Array.remove(userRoles, roleValue);
+ }
+ var userSaveService = org.argeo.security.ria.SecurityAPI.getUpdateUserService(response.getContent());
+ userSaveService.setAsynchronous(false);
+ userSaveService.send();
+ }, this);
+ userDetailService.setAsynchronous(false);
+ userDetailService.send();
+ }
+ this.fireDataEvent("changeRolesList", this.getRolesList());
+ modal.hide();
+ modal.destroy();