fixed update of account role mapping
This commit is contained in:
@ -121,7 +121,7 @@ public class AccountView implements Serializable {
|
||||
if ((currentAccount.getCreatedBy() == null) && (existingEntity != null)) {
|
||||
FacesUtil.addErrorMessage("editDialogMessaegs", "Create new account failed", "Account with username " + username + " already exists");
|
||||
} else {
|
||||
accountService.saveAccount(currentAccount, currentAccountRoles);
|
||||
accountService.saveAccount(currentAccount, applicationView.getCurrentApplication(), currentAccountRoles);
|
||||
// force accounts to be loaded from database again
|
||||
accountList = null;
|
||||
|
||||
@ -208,7 +208,7 @@ public class AccountView implements Serializable {
|
||||
if ((password != null) && (!password.trim().equals(""))) {
|
||||
// password has been specified
|
||||
if (password.equals(repeatPassword)) {
|
||||
currentAccount.getAccountLogin().setAccountPassword(accountService.getHashedPassword(password));
|
||||
currentAccountLogin.setAccountPassword(accountService.getHashedPassword(password));
|
||||
FacesUtil.addGlobalInfoMessage("Info", "Password updated");
|
||||
} else {
|
||||
// TODO connect to IPRS
|
||||
|
||||
@ -94,7 +94,7 @@ public class AccountControl implements Serializable {
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public AccountEntity saveAccount(AccountEntity account, List<ApplicationRoleEntity> applicationRoles) {
|
||||
public AccountEntity saveAccount(AccountEntity account, ApplicationEntity app, List<ApplicationRoleEntity> applicationRoles) {
|
||||
Date now = DateUtil.getCurrentTimeInUTC();
|
||||
Subject currentUser = SecurityUtils.getSubject();
|
||||
String currentLoggedInUser = currentUser.getPrincipal().toString();
|
||||
@ -127,7 +127,7 @@ public class AccountControl implements Serializable {
|
||||
List<ApplicationRoleEntity> assignedRoles = new ArrayList<>();
|
||||
assignedRoles.addAll(account.getApplicationRoleList());
|
||||
for (ApplicationRoleEntity currentlyAssignedRole : assignedRoles) {
|
||||
if ((currentlyAssignedRole.getApplication().equals(application) && (!applicationRoles.contains(currentlyAssignedRole)))) {
|
||||
if ((currentlyAssignedRole.getApplication().equals(app) && (!applicationRoles.contains(currentlyAssignedRole)))) {
|
||||
account.getApplicationRoleList().remove(currentlyAssignedRole);
|
||||
roleSetupChanged = true;
|
||||
if (LOGGER.isDebugEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user