@Test public void dataPropSubjectIsInfoResourceWithSelfEditingFeatured() { action = new AddDataPropStmt(URI_JOE_FEATURED_IN_IT, URI_PERMITTED_PREDICATE, "junk", null, null); assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action)); assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action)); }
@Test public void objectPropObjectIsInfoResourceWithSelfEditingEditor() { action = new AddObjectPropStmt(URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, URI_JOE_EDITED_IT); assertDecision(AUTHORIZED, policy.isAuthorized(idJoe, action)); assertDecision(AUTHORIZED, policy.isAuthorized(idBozoAndJoe, action)); }
@Test public void objectPropObjectIsInfoResourceButNoAuthorsOrEditors() { action = new AddObjectPropStmt(URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, URI_NOBODY_WROTE_IT); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action)); }
@Test public void objectPropObjectIsInfoResourceButWrongFeatured() { action = new AddObjectPropStmt( URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, URI_BOZO_FEATURED_IN_IT); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void objectPropNeitherSubjectOrObjectIsInfoResource() { action = new AddObjectPropStmt( URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void objectPropObjectIsInfoResourcebutNobodyIsSelfEditing() { action = new AddObjectPropStmt(URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, URI_JOE_EDITED_IT); assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action)); }
@Test public void objectPropSubjectIsInfoResourceButWrongEditor() { action = new AddObjectPropStmt(URI_BOZO_EDITED_IT, URI_PERMITTED_PREDICATE, URI_PERMITTED_RESOURCE); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void whatIsNull() { assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, null)); }
@Test public void dataPropSubjectIsInfoResourceButNoAuthorsOrEditorsOrFeatured() { action = new AddDataPropStmt(URI_NOBODY_WROTE_IT, URI_PERMITTED_PREDICATE, "junk", null, null); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); assertDecision(INCONCLUSIVE, policy.isAuthorized(idBozoAndJoe, action)); }
@Test public void dataPropSubjectIsInfoResourceButNobodyIsSelfEditing() { action = new AddDataPropStmt(URI_JOE_WROTE_IT, URI_PERMITTED_PREDICATE, "junk", null, null); assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action)); }
@Test public void objectPropObjectIsRestricted() { action = new AddObjectPropStmt(URI_JOE_EDITED_IT, URI_PERMITTED_PREDICATE, URI_RESTRICTED_RESOURCE); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void dataPropPredicateIsRestricted() { action = new AddDataPropStmt(URI_JOE_EDITED_IT, URI_RESTRICTED_PREDICATE, "junk", null, null); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void requestedActionOutOfScope() { action = new ServerStatus(); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void notSelfEditing() { action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE); assertDecision(INCONCLUSIVE, policy.isAuthorized(idNobody, action)); }
@Test public void dataPropSubjectIsNotInfoResource() { action = new AddDataPropStmt(URI_PERMITTED_RESOURCE, URI_PERMITTED_PREDICATE, "junk", null, null); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void dataPropSubjectIsInfoResourceButWrongFeatured() { action = new AddDataPropStmt(URI_BOZO_FEATURED_IN_IT, URI_PERMITTED_PREDICATE, "junk", null, null); assertDecision(INCONCLUSIVE, policy.isAuthorized(idJoe, action)); }
@Test public void whoIsNull() { action = new AddResource(RESOURCE_TYPE, URI_PERMITTED_RESOURCE); assertDecision(INCONCLUSIVE, policy.isAuthorized(null, action)); }