public static Boolean run(Person person, ExecutionCourse executionCourse) throws NotAuthorizedException {
try {
final Person loggedPerson = AccessControl.getPerson();
Professorship selectedProfessorship = null;
selectedProfessorship = person.getProfessorshipByExecutionCourse(executionCourse);
if ((loggedPerson == null) || (selectedProfessorship == null) || !loggedPerson.hasRole(RoleType.TEACHER)
|| isSamePersonAsBeingRemoved(loggedPerson, selectedProfessorship.getPerson())
|| selectedProfessorship.getResponsibleFor()) {
throw new NotAuthorizedException();
}
} catch (RuntimeException e) {
throw new NotAuthorizedException();
}
Professorship professorshipToDelete = person.getProfessorshipByExecutionCourse(executionCourse);
Collection shiftProfessorshipList = professorshipToDelete.getAssociatedShiftProfessorshipSet();
boolean hasCredits = false;
if (!shiftProfessorshipList.isEmpty()) {
hasCredits = CollectionUtils.exists(shiftProfessorshipList, new Predicate() {