marklogic / marklogic-jena

Adapter for using MarkLogic with the Jena RDF Framework
Other
5 stars 11 forks source link

Cannot update SPARQLUpdatepermissions #7

Closed kkanthet closed 9 years ago

kkanthet commented 9 years ago

setSPARQLPermissions not updating the permissions. Steps to reproduce:: Set READ permission to a dataset InsertData and create a graph Set UPDATE permission to the dataset InsertData to the same graph The Graph still has READ permission only

Expecting:: both READ and UPDATE for the role

 GraphPermissions graphPermissions = markLogicDatasetGraph.getPermissions(NodeFactory.createURI("http://test.perm/"));
         markLogicDatasetGraph.setSPARQLUpdatePermissions(graphPermissions.permission("test-perm", Capability.READ));
           update = new UpdateRequest();
            update.add("BASE <http://example.org/> INSERT DATA { GRAPH <http://example.org/copy1> { <s1> <p1> <o1>  } }");
            UpdateAction.execute(update, markLogicDatasetGraph);

            graphPermissions = markLogicDatasetGraph.getPermissions(NodeFactory.createURI("http://example.org/copy1"));
            System.out.println("Should have READ"+graphPermissions.get("test-perm"));
            assertTrue(graphPermissions.get("test-perm").contains(Capability.READ));

             markLogicDatasetGraph.setSPARQLUpdatePermissions(graphPermissions.permission("test-perm", Capability.UPDATE));

        update = new UpdateRequest();
        update.add("BASE <http://example.org/> INSERT DATA { GRAPH <http://example.org/copy1> { <s11> <p11> <o11>  } }");
        UpdateAction.execute(update, markLogicDatasetGraph);

        graphPermissions = markLogicDatasetGraph.getPermissions(NodeFactory.createURI("http://example.org/copy1"));
        System.out.println("Should have READ & UPDATE"+graphPermissions.get("test-perm"));
kkanthet commented 9 years ago

As per documentation permission is only set when creating new graph and ignored for the existing graphs