executionDegree = (ExecutionDegree) PersistenceSupportFactory.getDefaultPersistenceSupport()
executionDegree = (IExecutionDegree) PersistenceSupportFactory.getDefaultPersistenceSupport()
    private boolean hasPrivilege(IUserView id, Object[] arguments) {        List roles = getRoleList(id.getRoles());        CollectionUtils.intersection(roles, getNeededRoles());        /*         * String executionYearString = (String) arguments[0]; String degreeCode =         * (String) arguments[1];         */        Integer executionDegreeID = (Integer) arguments[0];        IExecutionDegree executionDegree = null;        // Read The DegreeCurricularPlan        try {            executionDegree = (ExecutionDegree) PersistenceSupportFactory.getDefaultPersistenceSupport()                    .getIPersistentExecutionDegree().readByOID(ExecutionDegree.class, executionDegreeID);        } catch (Exception e) {            return false;        }        if (executionDegree == null) {            return false;        }        List roleTemp = new ArrayList();        roleTemp.add(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE);        if (CollectionUtils.containsAny(roles, roleTemp)) {            if (executionDegree.getDegreeCurricularPlan().getDegree().getTipoCurso().equals(                    DegreeType.MASTER_DEGREE)) {                return true;            }            return false;        }        roleTemp = new ArrayList();        roleTemp.add(RoleType.COORDINATOR);        if (CollectionUtils.containsAny(roles, roleTemp)) {            // Read The ExecutionDegree            try {                // IMPORTANT: It's assumed that the coordinator for a Degree is                // ALWAYS the same                //modified by Tnia Pouso                List coodinatorsList = PersistenceSupportFactory.getDefaultPersistenceSupport().getIPersistentCoordinator()                        .readCoordinatorsByExecutionDegree(executionDegree.getIdInternal());                if (coodinatorsList == null) {                    return false;                }                ListIterator listIterator = coodinatorsList.listIterator();                while (listIterator.hasNext()) {                    ICoordinator coordinator = (ICoordinator) listIterator.next();                    if (id.getUtilizador().equals(coordinator.getTeacher().getPerson().getUsername())) {                        return true;                    }                }                //            	teacher = executionDegree.getCoordinator();                //                if (teacher == null)                //                {                //                    return false;                //                }                //                //                if                // (id.getUtilizador().equals(teacher.getPerson().getUsername()))                //                {                //                    return true;                //                } else                //                {                //                    return false;                //                }            } catch (Exception e) {                return false;            }        }        return false;    }