Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ public class AppUser extends AbstractPersistableCustom<Long> implements Platform

@Getter
@OneToMany(cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER, mappedBy = "appUser")
private Set<AppUserClientMapping> appUserClientMappings = new HashSet<>();

@Column(name = "cannot_change_password", nullable = true)
private Boolean cannotChangePassword;
Expand Down Expand Up @@ -194,8 +193,6 @@ public AppUser(final Office office, final User user, final Set<Role> roles, fina
this.lastTimePasswordUpdated = DateUtils.getLocalDateOfTenant();
this.staff = staff;
this.passwordNeverExpires = passwordNeverExpire;
this.isSelfServiceUser = isSelfServiceUser;
this.appUserClientMappings = createAppUserClientMappings(clients);
this.cannotChangePassword = cannotChangePassword;
}

Expand Down Expand Up @@ -326,21 +323,6 @@ public Map<String, Object> update(final JsonCommand command, final PlatformPassw
this.isSelfServiceUser = newValue;
}

if (this.isSelfServiceUser && command.hasParameter(AppUserConstants.CLIENTS)) {
actualChanges.put(AppUserConstants.CLIENTS, command.arrayValueOfParameterNamed(AppUserConstants.CLIENTS));
Set<AppUserClientMapping> newClients = createAppUserClientMappings(clients);
if (this.appUserClientMappings == null) {
this.appUserClientMappings = new HashSet<>();
} else {
this.appUserClientMappings.retainAll(newClients);
}
this.appUserClientMappings.addAll(newClients);
} else if (!this.isSelfServiceUser && actualChanges.containsKey(AppUserConstants.IS_SELF_SERVICE_USER)) {
actualChanges.put(AppUserConstants.CLIENTS, new ArrayList<>());
if (this.appUserClientMappings != null) {
this.appUserClientMappings.clear();
}
}

return actualChanges;
}
Expand Down Expand Up @@ -673,16 +655,6 @@ public boolean isNotEnabled() {
return !isEnabled();
}

private Set<AppUserClientMapping> createAppUserClientMappings(Collection<Client> clients) {
Set<AppUserClientMapping> newAppUserClientMappings = null;
if (clients != null && !clients.isEmpty()) {
newAppUserClientMappings = new HashSet<>();
for (Client client : clients) {
newAppUserClientMappings.add(new AppUserClientMapping(this, client));
}
}
return newAppUserClientMappings;
}

@Override
public String toString() {
Expand Down

This file was deleted.

Loading