return user != null && user.getPerson() != null && hasActiveCandidacies(user.getPerson());
}
private boolean hasActiveCandidacies(Person person) {
for (Candidacy candidacy : person.getCandidaciesSet()) {
CandidacySituationType situation = candidacy.getActiveCandidacySituationType();
if (situation != null && situation.isActive() && !situation.equals(CandidacySituationType.REGISTERED)) {
return true;
}
}
return false;
}