if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) { if (degreeCurricularPlan.getDegree().getTipoCurso().equals(DegreeType.MASTER_DEGREE)) { return true; } return false;
if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) { if (degreeCurricularPlan.getDegree().getTipoCurso().equals(DegreeType.MASTER_DEGREE) || degreeCurricularPlan.getDegree().getTipoCurso().equals( DegreeType.BOLONHA_ADVANCED_FORMATION_DIPLOMA)) { return true; } return false;
    private boolean hasPrivilege(IUserView id, Object[] arguments) {        Integer degreeCurricularPlanID = (Integer) arguments[0];        DegreeType degreeType = (DegreeType) arguments[1];        DegreeCurricularPlan degreeCurricularPlan = rootDomainObject                .readDegreeCurricularPlanByOID(degreeCurricularPlanID);        if ((degreeCurricularPlan == null)                || (!degreeCurricularPlan.getDegree().getTipoCurso().equals(degreeType))) {            return false;        }        if (id.hasRoleType(RoleType.MASTER_DEGREE_ADMINISTRATIVE_OFFICE)) {            if (degreeCurricularPlan.getDegree().getTipoCurso().equals(DegreeType.MASTER_DEGREE)) {                return true;            }            return false;        }        if (id.hasRoleType(RoleType.COORDINATOR)) {            List executionDegrees = degreeCurricularPlan.getExecutionDegrees();            if (executionDegrees == null || executionDegrees.isEmpty()) {                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;    }