Package org.apache.jena.security

Examples of org.apache.jena.security.SecurityEvaluator$SecNode


    private ExtendedIterator<Triple> wrapPermIterator(
        final SecuredGraphImpl sg, final Iterator<Triple> it,
        final Set<Action> perms )
    {
      final SecurityEvaluator evaluator = CachedSecurityEvaluator
          .getInstance(sg.getSecurityEvaluator(), runAs);
      if (!evaluator.evaluateAny(perms, sg.getModelNode(),
          SecuredItemImpl.convert(Triple.ANY)))
      {
        // nope so wrap the iterator with security iterator
        return WrappedIterator.create(it).filterKeep(
            new PermTripleFilter(perms, sg, evaluator));
View Full Code Here


      this.securityEvaluator = sg.getSecurityEvaluator();
    }
    else
    {
      graphIRI = new SecNode(Type.URI, "urn:x-arq:DefaultGraph");
      this.securityEvaluator = new SecurityEvaluator() {

        @Override
        public boolean evaluate( final Action action,
            final SecNode graphIRI )
        {
View Full Code Here

  }
 
  @Test
  public void testBGP()
  {
    SecurityEvaluator securityEvaluator =  new MockSecurityEvaluator( true, true, true, true, true, true );
    rewriter = new OpRewriter( securityEvaluator, "http://example.com/dummy");
   
    rewriter.visit( new OpBGP( BasicPattern.wrap(Arrays.asList(triples))));
    Op op = rewriter.getResult();
    Assert.assertTrue( "Should have been an OpFilter", op instanceof OpFilter );
View Full Code Here

  }
 
  @Test
  public void testBGPNoReadAccess()
  {
    SecurityEvaluator securityEvaluator =  new MockSecurityEvaluator( true, true, false, true, true, true );
    rewriter = new OpRewriter( securityEvaluator, "http://example.com/dummy");
    Triple[] triples = {
        new Triple( NodeFactory.createVariable("foo"), RDF.type.asNode(), NodeFactory.createURI( "http://example.com/class")),
        new Triple( NodeFactory.createVariable("foo"), NodeFactory.createAnon(), NodeFactory.createVariable("bar")),
        new Triple( NodeFactory.createVariable("bar"), NodeFactory.createAnon(), NodeFactory.createVariable("baz")),
View Full Code Here

  }

  @Test
  public void testOpenQueryType()
  {
    final SecurityEvaluator eval = new MockSecurityEvaluator(true, true,
        true, true, true, true);
    final SecuredModel model = Factory.getInstance(eval,
        "http://example.com/securedModel", baseModel);
    try
    {
View Full Code Here

  }

  @Test
  public void testRestrictedQueryType()
  {
    final SecurityEvaluator eval = new MockSecurityEvaluator(true, true,
        true, true, true, true) {

      @Override
      public boolean evaluate( final Action action,
          final SecNode graphIRI, final SecTriple triple )
View Full Code Here

    {
      Triple[] retval = triples;
      if (g instanceof SecuredGraphImpl)
      {
        final SecuredGraphImpl sg = (SecuredGraphImpl) g;
        final SecurityEvaluator evaluator = CachedSecurityEvaluator
            .getInstance(sg.getSecurityEvaluator(), runAs);
        if (evaluator.evaluateAny(perms, sg.getModelNode()))
        {
          if (!evaluator.evaluateAny(perms, sg.getModelNode(),
              SecuredItemImpl.convert(Triple.ANY)))
          {
            final List<Triple> list = wrapPermIterator(sg,
                Arrays.asList(triples).iterator(), perms)
                .toList();
View Full Code Here

    {
      Graph addGraph = added;
      if (g instanceof SecuredGraph)
      {
        final SecuredGraph sg = (SecuredGraph) g;
        final SecurityEvaluator evaluator = CachedSecurityEvaluator
            .getInstance(sg.getSecurityEvaluator(), runAs);
        if (evaluator.evaluateAny(SecuredGraphEventManager.ADD,
            sg.getModelNode()))
        {
          if (!evaluator.evaluateAny(SecuredGraphEventManager.ADD,
              sg.getModelNode(),
              SecuredItemImpl.convert(Triple.ANY)))
          {
            final List<Triple> lst = added.find(Triple.ANY)
                .toList();
View Full Code Here

    {

      if (g instanceof SecuredGraphImpl)
      {
        final SecuredGraphImpl sg = (SecuredGraphImpl) g;
        final SecurityEvaluator evaluator = CachedSecurityEvaluator
            .getInstance(sg.getSecurityEvaluator(), runAs);
        // only report if we can write to the graph
        if (evaluator.evaluateAny(SecuredGraphEventManager.ADD,
            sg.getModelNode()))
        {
          final ExtendedIterator<Triple> iter = wrapPermIterator(sg,
              it, SecuredGraphEventManager.ADD);
          try
View Full Code Here

    {
      List<Triple> list = triples;
      if (g instanceof SecuredGraphImpl)
      {
        final SecuredGraphImpl sg = (SecuredGraphImpl) g;
        final SecurityEvaluator evaluator = CachedSecurityEvaluator
            .getInstance(sg.getSecurityEvaluator(), runAs);
        if (evaluator.evaluateAny(SecuredGraphEventManager.ADD,
            sg.getModelNode()))
        {
          if (!evaluator.evaluateAny(SecuredGraphEventManager.ADD,
              sg.getModelNode(),
              SecuredItemImpl.convert(Triple.ANY)))
          {
            list = wrapPermIterator(sg, triples.iterator(),
                SecuredGraphEventManager.ADD).toList();
View Full Code Here

TOP

Related Classes of org.apache.jena.security.SecurityEvaluator$SecNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.