vyommani commented on code in PR #1145:
URL: https://github.com/apache/ranger/pull/1145#discussion_r3759306565
##########
security-admin/src/main/java/org/apache/ranger/rest/PublicAPIs.java:
##########
@@ -175,18 +177,31 @@ public void deleteRepository(@PathParam("id") Long id,
@Context HttpServletReque
@GET
@Path("/api/repository/")
@Produces("application/json")
+ @PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" +
RangerAPIList.SEARCH_X_ASSETS + "\")")
public VXRepositoryList searchRepositories(@Context HttpServletRequest
request) {
logger.debug("==> PublicAPIs.searchRepositories()");
+ VXRepositoryList ret = new VXRepositoryList();
+
SearchFilter filter =
searchUtil.getSearchFilterFromLegacyRequestForRepositorySearch(request,
xAssetService.sortFields);
List<RangerService> serviceList = serviceREST.getServices(filter);
- VXRepositoryList ret = null;
if (serviceList != null) {
- ret = serviceUtil.rangerServiceListToPublicObjectList(serviceList);
+ List<VXRepository> repositories = new ArrayList<>();
Review Comment:
please preallocating the ArrayList -> new ArrayList<>(serviceList.size()); ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]