mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
taskid 85555 Custom DSpaceControlledVocabulary for WB syntax - permissions
This commit is contained in:
@@ -60,7 +60,7 @@ public class VocabularyEntryDetailsRestRepository extends DSpaceRestRepository<V
|
||||
VocabularyEntryDetailsRest.PLURAL_NAME + "-search")));
|
||||
}
|
||||
|
||||
@PreAuthorize("permitAll()")
|
||||
@PreAuthorize("hasAuthority('AUTHENTICATED')")
|
||||
@Override
|
||||
public Page<VocabularyEntryDetailsRest> findAll(Context context, Pageable pageable) {
|
||||
throw new RepositoryMethodNotImplementedException(ResourcePolicyRest.NAME, "findAll");
|
||||
@@ -82,7 +82,7 @@ public class VocabularyEntryDetailsRestRepository extends DSpaceRestRepository<V
|
||||
}
|
||||
|
||||
@SearchRestMethod(name = "top")
|
||||
@PreAuthorize("hasAuthority('AUTHENTICATED')")
|
||||
@PreAuthorize("permitAll()")
|
||||
public Page<VocabularyEntryDetailsRest> findAllTop(@Parameter(value = "vocabulary", required = true)
|
||||
String vocabularyId, Pageable pageable) {
|
||||
Context context = obtainContext();
|
||||
|
@@ -256,8 +256,8 @@ public class VocabularyEntryDetailsIT extends AbstractControllerIntegrationTest
|
||||
@Test
|
||||
public void searchTopUnauthorizedTest() throws Exception {
|
||||
getClient().perform(get("/api/submission/vocabularyEntryDetails/search/top")
|
||||
.param("vocabulary", "srsc:SCB16"))
|
||||
.andExpect(status().isUnauthorized());
|
||||
.param("vocabulary", "srsc"))
|
||||
.andExpect(status().isOk());
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -331,7 +331,7 @@ public class VocabularyEntryDetailsIT extends AbstractControllerIntegrationTest
|
||||
public void srscSearchTopUnauthorizedTest() throws Exception {
|
||||
getClient().perform(get("/api/submission/vocabularyEntryDetails/search/top")
|
||||
.param("vocabulary", "srsc"))
|
||||
.andExpect(status().isUnauthorized());
|
||||
.andExpect(status().isOk());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
Reference in New Issue
Block a user