public void removeRolesFromUser() throws Exception { ( (UIEESecurity) security ).removeRolesFromSelectedUser( userDetailTable.getSelectedItems() ); service.updateUser( security.getSelectedUser().getUserInfo() ); }
/** * updateUser method is called when user has click ok on a edit user dialog. The method updates the user * * @throws Exception */ @Override protected void updateUser() { if ( service != null ) { try { UIEERepositoryUser uiUser = (UIEERepositoryUser) eeSecurity.getSelectedUser(); Set<IUIRole> previousRoleList = new HashSet<IUIRole>(); previousRoleList.addAll( uiUser.getRoles() ); uiUser.setDescription( eeSecurityUser.getDescription() ); uiUser.setPassword( eeSecurityUser.getPassword() ); uiUser.setRoles( new HashSet<IUIRole>( eeSecurityUser.getAssignedRoles() ) ); service.updateUser( uiUser.getUserInfo() ); eeSecurity.updateUser( uiUser, previousRoleList ); userDialog.hide(); } catch ( Throwable th ) { if ( mainController == null || !mainController.handleLostRepository( th ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) );//$NON-NLS-1$ messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) );//$NON-NLS-1$ messageBox.setMessage( BaseMessages .getString( PKG, "UpdateUser.UnableToUpdateUser", th.getLocalizedMessage() ) );//$NON-NLS-1$ messageBox.open(); } } } }
/** * updateUser method is called when user has click ok on a edit user dialog. The method updates the user * * @throws Exception */ protected void updateUser() { if ( service != null ) { try { IUIUser uiUser = security.getSelectedUser(); uiUser.setDescription( securityUser.getDescription() ); uiUser.setPassword( securityUser.getPassword() ); service.updateUser( uiUser.getUserInfo() ); security.updateUser( uiUser ); userDialog.hide(); } catch ( Throwable th ) { if ( mainController == null || !mainController.handleLostRepository( th ) ) { messageBox.setTitle( BaseMessages.getString( PKG, "Dialog.Error" ) ); messageBox.setAcceptLabel( BaseMessages.getString( PKG, "Dialog.Ok" ) ); messageBox.setMessage( BaseMessages.getString( PKG, "UpdateUser.UnableToUpdateUser", th .getLocalizedMessage() ) ); messageBox.open(); } } } }