NIHVIVO-3404 Require that the statement-based RequestedActions include a reference to an OntModel. So the paradigm changes from "may I do this with this statement?" to "may I do this with this statement and this model?"
This commit is contained in:
parent
ae9890875f
commit
671c6214c4
1 changed files with 59 additions and 46 deletions
|
@ -180,35 +180,37 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsRestricted() {
|
public void dataPropSubjectIsRestricted() {
|
||||||
action = new AddDataPropertyStatement(URI_RESTRICTED_RESOURCE,
|
action = new AddDataPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_RESTRICTED_RESOURCE, URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropPredicateIsRestricted() {
|
public void dataPropPredicateIsRestricted() {
|
||||||
action = new AddDataPropertyStatement(URI_JOE_EDITED_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
|
||||||
URI_RESTRICTED_PREDICATE);
|
URI_RESTRICTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsRestricted() {
|
public void objectPropSubjectIsRestricted() {
|
||||||
action = new AddObjectPropertyStatement(URI_RESTRICTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
|
URI_RESTRICTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_JOE_EDITED_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropPredicateIsRestricted() {
|
public void objectPropPredicateIsRestricted() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_RESTRICTED_PREDICATE, URI_JOE_EDITED_IT);
|
URI_PERMITTED_RESOURCE, URI_RESTRICTED_PREDICATE,
|
||||||
|
URI_JOE_EDITED_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsRestricted() {
|
public void objectPropObjectIsRestricted() {
|
||||||
action = new AddObjectPropertyStatement(URI_JOE_EDITED_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_RESTRICTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_RESTRICTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
@ -219,14 +221,14 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceButNobodyIsSelfEditing() {
|
public void dataPropSubjectIsInfoResourceButNobodyIsSelfEditing() {
|
||||||
action = new AddDataPropertyStatement(URI_JOE_WROTE_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceButNoAuthorsOrEditorsOrFeatured() {
|
public void dataPropSubjectIsInfoResourceButNoAuthorsOrEditorsOrFeatured() {
|
||||||
action = new AddDataPropertyStatement(URI_NOBODY_WROTE_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -234,28 +236,28 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceButWrongAuthor() {
|
public void dataPropSubjectIsInfoResourceButWrongAuthor() {
|
||||||
action = new AddDataPropertyStatement(URI_BOZO_WROTE_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceButWrongEditor() {
|
public void dataPropSubjectIsInfoResourceButWrongEditor() {
|
||||||
action = new AddDataPropertyStatement(URI_BOZO_EDITED_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceButWrongFeatured() {
|
public void dataPropSubjectIsInfoResourceButWrongFeatured() {
|
||||||
action = new AddDataPropertyStatement(URI_BOZO_FEATURED_IN_IT,
|
action = new AddDataPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_BOZO_FEATURED_IN_IT, URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceWithSelfEditingAuthor() {
|
public void dataPropSubjectIsInfoResourceWithSelfEditingAuthor() {
|
||||||
action = new AddDataPropertyStatement(URI_JOE_WROTE_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_JOE_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -263,7 +265,7 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceWithSelfEditingEditor() {
|
public void dataPropSubjectIsInfoResourceWithSelfEditingEditor() {
|
||||||
action = new AddDataPropertyStatement(URI_JOE_EDITED_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_JOE_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -271,7 +273,7 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsInfoResourceWithSelfEditingFeatured() {
|
public void dataPropSubjectIsInfoResourceWithSelfEditingFeatured() {
|
||||||
action = new AddDataPropertyStatement(URI_JOE_FEATURED_IN_IT,
|
action = new AddDataPropertyStatement(ontModel, URI_JOE_FEATURED_IN_IT,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -279,14 +281,14 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceButNobodyIsSelfEditing() {
|
public void objectPropSubjectIsInfoResourceButNobodyIsSelfEditing() {
|
||||||
action = new AddObjectPropertyStatement(URI_JOE_EDITED_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceButNoAuthorsOrEditorsOrFeatured() {
|
public void objectPropSubjectIsInfoResourceButNoAuthorsOrEditorsOrFeatured() {
|
||||||
action = new AddObjectPropertyStatement(URI_NOBODY_WROTE_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_NOBODY_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -294,28 +296,29 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceButWrongAuthor() {
|
public void objectPropSubjectIsInfoResourceButWrongAuthor() {
|
||||||
action = new AddObjectPropertyStatement(URI_BOZO_WROTE_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_BOZO_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceButWrongEditor() {
|
public void objectPropSubjectIsInfoResourceButWrongEditor() {
|
||||||
action = new AddObjectPropertyStatement(URI_BOZO_EDITED_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_BOZO_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceButWrongFeatured() {
|
public void objectPropSubjectIsInfoResourceButWrongFeatured() {
|
||||||
action = new AddObjectPropertyStatement(URI_BOZO_FEATURED_IN_IT,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_BOZO_FEATURED_IN_IT, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceWithSelfEditingAuthor() {
|
public void objectPropSubjectIsInfoResourceWithSelfEditingAuthor() {
|
||||||
action = new AddObjectPropertyStatement(URI_JOE_WROTE_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_JOE_WROTE_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -323,7 +326,7 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceWithSelfEditingEditor() {
|
public void objectPropSubjectIsInfoResourceWithSelfEditingEditor() {
|
||||||
action = new AddObjectPropertyStatement(URI_JOE_EDITED_IT,
|
action = new AddObjectPropertyStatement(ontModel, URI_JOE_EDITED_IT,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
|
@ -331,68 +334,77 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropSubjectIsInfoResourceWithSelfEditingFeatured() {
|
public void objectPropSubjectIsInfoResourceWithSelfEditingFeatured() {
|
||||||
action = new AddObjectPropertyStatement(URI_JOE_FEATURED_IN_IT,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_JOE_FEATURED_IN_IT, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourcebutNobodyIsSelfEditing() {
|
public void objectPropObjectIsInfoResourcebutNobodyIsSelfEditing() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_JOE_EDITED_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceButNoAuthorsOrEditors() {
|
public void objectPropObjectIsInfoResourceButNoAuthorsOrEditors() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_NOBODY_WROTE_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_NOBODY_WROTE_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceButWrongAuthor() {
|
public void objectPropObjectIsInfoResourceButWrongAuthor() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_BOZO_WROTE_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_BOZO_WROTE_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceButWrongEditor() {
|
public void objectPropObjectIsInfoResourceButWrongEditor() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_BOZO_EDITED_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_BOZO_EDITED_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceButWrongFeatured() {
|
public void objectPropObjectIsInfoResourceButWrongFeatured() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_BOZO_FEATURED_IN_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_BOZO_FEATURED_IN_IT);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceWithSelfEditingAuthor() {
|
public void objectPropObjectIsInfoResourceWithSelfEditingAuthor() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_JOE_WROTE_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_JOE_WROTE_IT);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceWithSelfEditingEditor() {
|
public void objectPropObjectIsInfoResourceWithSelfEditingEditor() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_JOE_EDITED_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_JOE_EDITED_IT);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropObjectIsInfoResourceWithSelfEditingFeatured() {
|
public void objectPropObjectIsInfoResourceWithSelfEditingFeatured() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_JOE_FEATURED_IN_IT);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_JOE_FEATURED_IN_IT);
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action));
|
||||||
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action));
|
||||||
}
|
}
|
||||||
|
@ -403,15 +415,16 @@ public class SelfEditorRelationshipPolicyTest extends AbstractTestClass {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void dataPropSubjectIsNotInfoResource() {
|
public void dataPropSubjectIsNotInfoResource() {
|
||||||
action = new AddDataPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddDataPropertyStatement(ontModel, URI_PERMITTED_RESOURCE,
|
||||||
URI_PERMITTED_PREDICATE);
|
URI_PERMITTED_PREDICATE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void objectPropNeitherSubjectOrObjectIsInfoResource() {
|
public void objectPropNeitherSubjectOrObjectIsInfoResource() {
|
||||||
action = new AddObjectPropertyStatement(URI_PERMITTED_RESOURCE,
|
action = new AddObjectPropertyStatement(ontModel,
|
||||||
URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE);
|
URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE,
|
||||||
|
URI_PERMITTED_RESOURCE);
|
||||||
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue