1. fixed auth expression when updating a repository

2. filter out ftp interfaces
This commit is contained in:
Konstantinos Spyrou 2022-11-08 18:37:51 +00:00
parent 1491d8e280
commit ee01491995
2 changed files with 5 additions and 2 deletions

View File

@ -187,7 +187,7 @@ public class RepositoryController {
@RequestMapping(value = "/updateRepository", method = RequestMethod.POST,
consumes = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
@PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOfInterface(#repository.id)")
@PreAuthorize("hasAuthority('SUPER_ADMINISTRATOR') or hasAuthority('CONTENT_PROVIDER_DASHBOARD_ADMINISTRATOR') or @authorizationService.isMemberOf(#repository.id)")
public Repository updateRepository(@RequestBody Repository repository, Authentication authentication) throws Exception {
return repositoryService.updateRepository(repository, authentication);
}

View File

@ -477,8 +477,11 @@ public class RepositoryServiceImpl implements RepositoryService {
List<ApiDetails> res = new ArrayList<>();
for (ApiDetails det: rs.getApi()) {
if (!det.getProtocol().equals("sword") && !det.getProtocol().equals("rest"))
if (!det.getProtocol().equals("sword") &&
!det.getProtocol().equals("rest") &&
!det.getProtocol().equals("ftp")) {
res.add(det);
}
}
return converter.toRepositoryInterfaceList(res);