taskid 85555 Custom DSpaceControlledVocabulary for WB syntax - permissions

This commit is contained in:
Samuel
2021-12-08 10:09:41 +01:00
committed by Jens Vannerum
parent a6992efd45
commit 188d02c822
2 changed files with 5 additions and 5 deletions

View File

@@ -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();

View File

@@ -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