Skip to content

Commit

Permalink
SAK-46014 - Can't activate user when no maintain user is already acti…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielmerino authored Aug 20, 2021
1 parent 867d995 commit 3226d2c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8960,6 +8960,8 @@ private List<Participant> testProposedUpdates(List<Participant> participants, Pa

// create list of all participants that have been inactivated
Set<String> inactivatedParticipants = new HashSet();
// create list of all participants that have been activated
Set<String> activatedParticipants = new HashSet();
for(Participant statusParticipant : participants ) {
String activeGrantId = statusParticipant.getUniqname();
String activeGrantField = "activeGrant" + activeGrantId;
Expand All @@ -8969,6 +8971,9 @@ private List<Participant> testProposedUpdates(List<Participant> participants, Pa
if (activeStatus == false) {
inactivatedParticipants.add(activeGrantId);
}
else {
activatedParticipants.add(activeGrantId);
}
}
}

Expand All @@ -8980,7 +8985,7 @@ private List<Participant> testProposedUpdates(List<Participant> participants, Pa
String newRole = params.getString(roleId);

// skip any that are not already inactive or are not candidates for inactivation
if (!inactivatedParticipants.contains(id) && roleParticipant.isActive()) {
if ((!inactivatedParticipants.contains(id) && roleParticipant.isActive()) || (activatedParticipants.contains(id))) {
if (!removedParticipantIds.contains(id)) {
if (StringUtils.isNotBlank(newRole)){
if (newRole.equals(maintainRole)) {
Expand Down

0 comments on commit 3226d2c

Please sign in to comment.