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