@Override public void visit(final OpBGP opBGP) throws ReadDeniedException, AuthenticationRequiredException { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpBGP"); } Object principal = securityEvaluator.getPrincipal(); if (!securityEvaluator.evaluate(principal, Action.Read, graphIRI)) { if (silentFail) { return; } else { throw new ReadDeniedException(SecuredItem.Util.modelPermissionMsg(graphIRI)); } } // if the user can read any triple just add the opBGP if (securityEvaluator.evaluate(principal, Action.Read, graphIRI, Triple.ANY)) { addOp(opBGP); } else { // add security filtering to the resulting triples final List<Triple> newBGP = new ArrayList<>(); final List<Node> variables = new ArrayList<>(); // register all variables for (final Triple t : opBGP.getPattern().getList()) { newBGP.add(registerBGPTriple(t, variables)); } // create the security function. final SecuredFunction secFunc = new SecuredFunction(graphIRI, securityEvaluator, variables, newBGP); // create the filter Op filter = OpFilter.filter(secFunc, new OpBGP(BasicPattern.wrap(newBGP))); // add the filter addOp(filter); } }
/** rewrites the subop of proc. */ @Override public void visit(final OpProcedure opProc) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpProc"); } if (opProc.getProcId() != null) { addOp(new OpProcedure(opProc.getProcId(), opProc.getArgs(), rewriteOp1(opProc))); } else { addOp(new OpProcedure(opProc.getURI(), opProc.getArgs(), rewriteOp1(opProc))); } }
/** rewrites the subop of order. */ @Override public void visit(final OpOrder opOrder) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpOrder"); } addOp(new OpOrder(rewriteOp1(opOrder), opOrder.getConditions())); }
/** returns the null */ @Override public void visit(final OpNull opNull) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpNull"); } addOp(opNull); }
/** rewrites the subop of list. */ @Override public void visit(final OpList opList) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpList"); } addOp(new OpList(rewriteOp1(opList))); }
/** rewrites the subop of group. */ @Override public void visit(final OpGroup opGroup) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpGroup"); } addOp(new OpGroup(rewriteOp1(opGroup), opGroup.getGroupVars(), opGroup.getAggregators())); }
/** rewrites the subop of filter. */ @Override public void visit(final OpFilter opFilter) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpFilter"); } addOp(OpFilter.filterBy(opFilter.getExprs(), rewriteOp1(opFilter))); }
/** rewrites the subop of extend. */ @Override public void visit(final OpExtend opExtend) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpExtend"); } addOp(OpExtend.extend(rewriteOp1(opExtend), opExtend.getVarExprList())); }
/** Returns the Ext */ @Override public void visit(final OpExt opExt) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpExt"); } addOp(opExt); }
/** Rewrite sequence elements */ @Override public void visit(final OpDisjunction opDisjunction) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpDisjunction"); } addOp(rewriteOpN(opDisjunction, OpDisjunction.create())); }
/** returns the dsNames */ @Override public void visit(final OpDatasetNames dsNames) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpDatasetName"); } addOp(dsNames); }
/** Returns the path */ @Override public void visit(final OpPath opPath) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpPath"); } addOp(opPath); }
@Override public void visit(OpQuadBlock quadBlock) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpQuadBlock"); } addOp(quadBlock); }
/** rewrites the subop of assign. */ @Override public void visit(final OpAssign opAssign) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpAssign"); } addOp(OpAssign.assign(rewriteOp1(opAssign), opAssign.getVarExprList())); }
/** rewrites the subop of top. */ @Override public void visit(final OpTopN opTop) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpTop"); } addOp(new OpTopN(rewriteOp1(opTop), opTop.getLimit(), opTop.getConditions())); }
/** returns the service */ @Override public void visit(final OpService opService) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting opService"); } addOp(opService); }
/** returns the table */ @Override public void visit(final OpTable opTable) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpTable"); } addOp(opTable); }
/** rewrites the subop of reduced. */ @Override public void visit(final OpReduced opReduced) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpReduced"); } addOp(OpReduced.create(rewriteOp1(opReduced))); }
/** Rewrite sequence elements */ @Override public void visit(final OpSequence opSequence) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpSequence"); } addOp(rewriteOpN(opSequence, OpSequence.create())); }
/** Returns the quadpattern */ @Override public void visit(final OpQuadPattern quadPattern) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpQuadPattern"); } addOp(quadPattern); }
/** Returns the quad */ @Override public void visit(final OpQuad opQuad) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpQuad"); } addOp(opQuad); }
/** rewrites the subop of project. */ @Override public void visit(final OpProject opProject) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpProject"); } addOp(new OpProject(rewriteOp1(opProject), opProject.getVars())); }
/** Rewrite left and right */ @Override public void visit(final OpUnion opUnion) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpUnion"); } final OpRewriter rewriter = new OpRewriter(securityEvaluator, graphIRI); addOp(OpUnion.create(rewriteOp2(opUnion, rewriter), rewriter.getResult())); }
/** rewrites the subop of graph. */ @Override public void visit(final OpGraph opGraph) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpGraph"); } final OpRewriter rewriter = new OpRewriter(securityEvaluator, opGraph.getNode()); opGraph.getSubOp().visit(rewriter); addOp(new OpGraph(opGraph.getNode(), rewriter.getResult())); }
/** rewrites the subop of propFunc. */ @Override public void visit(final OpPropFunc opPropFunc) { if (LOG.isDebugEnabled()) { LOG.debug("Starting visiting OpPropFunc"); } addOp( new OpPropFunc( opPropFunc.getProperty(), opPropFunc.getSubjectArgs(), opPropFunc.getObjectArgs(), rewriteOp1(opPropFunc))); }