mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Fix for calls from the administration (workflow)
This commit is contained in:
@@ -23,7 +23,6 @@ import org.dspace.core.Context;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.rest.webmvc.ResourceNotFoundException;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -39,7 +38,6 @@ public class ItemAccessStatusLinkRepository extends AbstractDSpaceRestRepository
|
||||
@Autowired
|
||||
AccessStatusService accessStatusService;
|
||||
|
||||
@PreAuthorize("hasPermission(#itemId, 'ITEM', 'READ')")
|
||||
public AccessStatusRest getAccessStatus(@Nullable HttpServletRequest request,
|
||||
UUID itemId,
|
||||
@Nullable Pageable optionalPageable,
|
||||
|
@@ -3862,6 +3862,8 @@ public class ItemRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$.inArchive", Matchers.is(false)))
|
||||
.andExpect(jsonPath("$._links.self.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString())))
|
||||
.andExpect(jsonPath("$._links.accessStatus.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/accessStatus")))
|
||||
.andExpect(jsonPath("$._links.bundles.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/bundles")))
|
||||
.andExpect(jsonPath("$._links.mappedCollections.href",
|
||||
@@ -3885,7 +3887,7 @@ public class ItemRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
getClient(tokenEperson).perform(get("/api/core/items/" + item.getID())
|
||||
.param("projection", "full"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$", HalMatcher.matchNoEmbeds()))
|
||||
.andExpect(jsonPath("$", HalMatcher.matchEmbeds("accessStatus")))
|
||||
.andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString())))
|
||||
.andExpect(jsonPath("$.name", Matchers.is(item.getName())))
|
||||
.andExpect(jsonPath("$.handle", Matchers.is(item.getHandle())))
|
||||
@@ -3894,6 +3896,8 @@ public class ItemRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
.andExpect(jsonPath("$.inArchive", Matchers.is(false)))
|
||||
.andExpect(jsonPath("$._links.self.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString())))
|
||||
.andExpect(jsonPath("$._links.accessStatus.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/accessStatus")))
|
||||
.andExpect(jsonPath("$._links.bundles.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/bundles")))
|
||||
.andExpect(jsonPath("$._links.mappedCollections.href",
|
||||
@@ -3916,7 +3920,7 @@ public class ItemRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
getClient().perform(get("/api/core/items/" + item.getID())
|
||||
.param("projection", "full"))
|
||||
.andExpect(status().isOk())
|
||||
.andExpect(jsonPath("$", HalMatcher.matchNoEmbeds()))
|
||||
.andExpect(jsonPath("$", HalMatcher.matchEmbeds("accessStatus")))
|
||||
.andExpect(jsonPath("$.uuid", Matchers.is(item.getID().toString())))
|
||||
.andExpect(jsonPath("$.name", Matchers.is(item.getName())))
|
||||
.andExpect(jsonPath("$.handle", Matchers.is(item.getHandle())))
|
||||
@@ -3927,6 +3931,8 @@ public class ItemRestRepositoryIT extends AbstractControllerIntegrationTest {
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString())))
|
||||
.andExpect(jsonPath("$._links.self.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString())))
|
||||
.andExpect(jsonPath("$._links.accessStatus.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/accessStatus")))
|
||||
.andExpect(jsonPath("$._links.bundles.href",
|
||||
Matchers.containsString("/api/core/items/" + item.getID().toString() + "/bundles")))
|
||||
.andExpect(jsonPath("$._links.mappedCollections.href",
|
||||
|
Reference in New Issue
Block a user