User userViewLogged = Authenticate.getUser();
boolean executionCourseResponsibleLogged = professorshipLogged.isResponsibleFor();
if (userViewLogged == null || professorshipLogged == null) {
throw new NotAuthorizedException("error.summary.not.authorized");
}
if (executionCourseResponsibleLogged
&& (summary.getProfessorship() != null && (!summary.getProfessorship().equals(professorshipLogged)))) {
throw new NotAuthorizedException("error.summary.not.authorized");
} else if (!executionCourseResponsibleLogged
&& (summary.getProfessorship() == null || (!summary.getProfessorship().equals(professorshipLogged)))) {
throw new NotAuthorizedException("error.summary.not.authorized");
}
} catch (RuntimeException ex) {
throw new NotAuthorizedException("error.summary.not.authorized");
}
}