IPessoaPersistente personDAO = persistentSupport.getIPessoaPersistente();
    public void execute(ServiceRequest serviceRequest, ServiceResponse serviceResponse) throws Exception {        IUserView requester = (IUserView) serviceRequest.getRequester();        if ((requester == null)                || !AuthorizationUtils.containsRole(requester.getRoles(),                        RoleType.DEPARTMENT_CREDITS_MANAGER)) {            throw new NotAuthorizedException();        }        Integer teacherId = getTeacherId(serviceRequest.getServiceParameters().parametersArray());        if (teacherId != null) {            IPessoaPersistente personDAO = persistentSupport.getIPessoaPersistente();            Person requesterPerson = Person.readPersonByUsername(requester.getUtilizador());            Teacher teacher = (Teacher) persistentObject.readByOID(Teacher.class, teacherId);            Department teacherDepartment = teacher.getCurrentWorkingDepartment();            List departmentsWithAccessGranted = requesterPerson.getManageableDepartmentCredits();            if (!departmentsWithAccessGranted.contains(teacherDepartment)) {                throw new NotAuthorizedException();            }        }    }