Mind review findings

This commit is contained in:
Eduard Heimbuch
2020-10-21 12:46:26 +02:00
parent 9f29c13ae0
commit 69950f63b3
10 changed files with 83 additions and 69 deletions

View File

@@ -389,8 +389,8 @@ public class DefaultUserManager extends AbstractUserManager
if (user == null) {
throw new NotFoundException(User.class, userId);
}
if (isAnonymousUser(user)) {
throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()), user.getType());
if (isAnonymousUser(user) || user.isExternal()) {
throw new ChangePasswordNotAllowedException(ContextEntry.ContextBuilder.entity("PasswordChange", "-").in(User.class, user.getName()), "external");
}
user.setPassword(newPassword);
this.modify(user);