use of org.apache.jena.permissions.SecurityEvaluator in project jena by apache.
the class SecuredAssemblerTest method testSecurityEvaluatorWithModelArgs.
@Test
public void testSecurityEvaluatorWithModelArgs() throws Exception {
Resource r = model.createResource("http://apache.org/jena/permissions/test#secEvaluator2");
Object o = assembler.open(r);
Assert.assertTrue(o instanceof SecurityEvaluator);
Assert.assertTrue(o instanceof ModelBasedSecurityEvaluator);
}
use of org.apache.jena.permissions.SecurityEvaluator in project jena by apache.
the class SecuredAssemblerTest method testSecurityEvaluatorWithStringArgs.
@Test
public void testSecurityEvaluatorWithStringArgs() throws Exception {
Resource r = model.createResource("http://apache.org/jena/permissions/test#secEvaluator");
Object o = assembler.open(r);
Assert.assertTrue(o instanceof SecurityEvaluator);
Assert.assertTrue(o instanceof StaticSecurityEvaluator);
}
use of org.apache.jena.permissions.SecurityEvaluator in project jena by apache.
the class SecuredQueryEngine method setGraphIRI.
private void setGraphIRI(final DatasetGraph dataset) {
final Graph g = dataset.getDefaultGraph();
if (g instanceof SecuredGraph) {
final SecuredGraph sg = (SecuredGraph) g;
graphIRI = sg.getModelNode();
this.securityEvaluator = sg.getSecurityEvaluator();
} else {
graphIRI = NodeFactory.createURI("urn:x-arq:DefaultGraph");
this.securityEvaluator = new SecurityEvaluator() {
@Override
public boolean evaluate(final Object principal, final Action action, final Node graphIRI) {
return true;
}
@Override
public boolean evaluate(final Object principal, final Action action, final Node graphIRI, final Triple triple) {
return true;
}
@Override
public boolean evaluate(final Object principal, final Set<Action> action, final Node graphIRI) {
return true;
}
@Override
public boolean evaluate(final Object principal, final Set<Action> action, final Node graphIRI, final Triple triple) {
return true;
}
@Override
public boolean evaluateAny(final Object principal, final Set<Action> action, final Node graphIRI) {
return true;
}
@Override
public boolean evaluateAny(final Object principal, final Set<Action> action, final Node graphIRI, final Triple triple) {
return true;
}
@Override
public boolean evaluateUpdate(final Object principal, final Node graphIRI, final Triple from, final Triple to) {
return true;
}
@Override
public Principal getPrincipal() {
return null;
}
@Override
public boolean isPrincipalAuthenticated(Object principal) {
return true;
}
};
}
}
Aggregations