use of org.apache.jena.fuseki.auth.AuthPolicy in project jena by apache.
the class TestAuthorized method auth_anon.
@Test
public void auth_anon() {
AuthPolicy auth = Auth.ANY_ANON;
assertTrue(auth.isAllowed(null));
assertTrue(auth.isAllowed("user1"));
}
use of org.apache.jena.fuseki.auth.AuthPolicy in project jena by apache.
the class TestAuthorized method auth_user_1.
@Test
public void auth_user_1() {
AuthPolicy auth = Auth.policyAllowSpecific("user1", "user2");
assertFalse(auth.isAllowed(null));
assertTrue(auth.isAllowed("user1"));
assertTrue(auth.isAllowed("user2"));
assertFalse(auth.isAllowed("user3"));
}
use of org.apache.jena.fuseki.auth.AuthPolicy in project jena by apache.
the class TestAuthorized method auth_parse_no_info_1.
@Test
public void auth_parse_no_info_1() {
Resource r = model.createResource("http://example/notInData");
AuthPolicy auth = FusekiConfig.allowedUsers(r);
assertNull(auth);
}
use of org.apache.jena.fuseki.auth.AuthPolicy in project jena by apache.
the class TestAuthorized method auth_parse_no_info_2.
@Test
public void auth_parse_no_info_2() {
Resource r = model.createResource("http://example/none");
AuthPolicy auth = FusekiConfig.allowedUsers(r);
assertNull(auth);
}
use of org.apache.jena.fuseki.auth.AuthPolicy in project jena by apache.
the class TestAuthorized method auth_parse_loggedIn.
@Test
public void auth_parse_loggedIn() {
Resource r = model.createResource("http://example/rLoggedIn");
AuthPolicy auth = FusekiConfig.allowedUsers(r);
assertNotNull(auth);
assertFalse(auth.isAllowed(null));
assertTrue(auth.isAllowed("user1"));
assertTrue(auth.isAllowed("user3"));
}
Aggregations