if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) { if (curricularCourseScope.getCurricularCourse().getDegreeCurricularPlan().getDegree() .getTipoCurso().equals(DegreeType.MASTER_DEGREE)) { return true; } return false;
if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) { DegreeType degreeType = curricularCourseScope.getCurricularCourse() .getDegreeCurricularPlan().getDegree().getTipoCurso(); if (degreeType.equals(DegreeType.MASTER_DEGREE) || degreeType.equals(DegreeType.BOLONHA_ADVANCED_FORMATION_DIPLOMA)) { return true; } return false;
    private boolean hasPrivilege(IUserView id, Object[] arguments) {        Integer curricularCourseScopeID = (Integer) arguments[1];        CurricularCourseScope curricularCourseScope = rootDomainObject.readCurricularCourseScopeByOID(curricularCourseScopeID);        if (curricularCourseScope == null) {            return false;        }        if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) {            if (curricularCourseScope.getCurricularCourse().getDegreeCurricularPlan().getDegree()                    .getTipoCurso().equals(DegreeType.MASTER_DEGREE)) {                return true;            }            return false;        }        if (id.hasRoleType(RoleType.COORDINATOR)) {            List executionDegrees = curricularCourseScope.getCurricularCourse()                    .getDegreeCurricularPlan().getExecutionDegrees();            if (executionDegrees == null) {                return false;            }            // IMPORTANT: It's assumed that the coordinator for a Degree is            // ALWAYS the same            // modified by Tnia Pouso            List<Coordinator> coodinatorsList = ((ExecutionDegree) executionDegrees.get(0))                    .getCoordinatorsList();            if (coodinatorsList == null) {                return false;            }            ListIterator listIterator = coodinatorsList.listIterator();            while (listIterator.hasNext()) {                Coordinator coordinator = (Coordinator) listIterator.next();                if (id.getUtilizador().equals(coordinator.getTeacher().getPerson().getUsername())) {                    return true;                }            }        }        return false;    }