TYPE entity = getExistentEntity();
if (entity.getId() == getCollaboratorId()) {
checkCommandAccessibility(COMMAND_CHANGE_OWN_PASSWORD);
if (entity.getPasswordHash()!= null && !MessageDigest.isEqual(entity.getPasswordHash(), anOldPasswordHash)) {
return new ModificationInfo(ConfigBeanRemoteM.INVALID_OLD_ADMIN_PASSWORD, (AuditDetails) null);
}
} else {
checkCommandAccessibility(COMMAND_WRITE_COLLABORATOR_RIGHTS);
}
AuditDoc<CollaboratorAbstract> auditDoc = new AuditDoc<CollaboratorAbstract>(entity, getCollaborator());
entity.setPasswordHash(aNewPasswordHash);
saveEntity(entity);
auditDoc.check(entity);
return new ModificationInfo(ConfigBeanRemoteM.ADMIN_PASSWORD_CHANGED, persistAudit(auditDoc));
}