added attribute param in IT and added check that allow READ request

This commit is contained in:
Mykhaylo
2020-03-12 12:03:58 +01:00
parent e22bb5d94d
commit 9bf24e7ffa
2 changed files with 5 additions and 1 deletions

View File

@@ -85,8 +85,11 @@ public class AuthorizeServicePermissionEvaluatorPlugin extends RestObjectPermiss
return true;
}
// If the item is still inprogress we can process here only the READ permission.
// Other actions need to be evaluated against the wrapper object (workspace or workflow item)
if (dSpaceObject instanceof Item) {
if (!((Item) dSpaceObject).isArchived() && !((Item) dSpaceObject).isWithdrawn()) {
if (!DSpaceRestPermission.READ.equals(restPermission)
&& !((Item) dSpaceObject).isArchived() && !((Item) dSpaceObject).isWithdrawn()) {
return false;
}
}

View File

@@ -771,6 +771,7 @@ public class WorkflowItemRestRepositoryIT extends AbstractControllerIntegrationT
// submit the workspaceitem to start the workflow
getClient(authToken)
.perform(post(BASE_REST_SERVER_URL + "/api/workflow/workflowitems")
.param("projection", "full")
.content("/api/submission/workspaceitems/" + wsitem.getID())
.contentType(textUriContentType))
.andExpect(status().isCreated())