-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75359/#review227276
-----------------------------------------------------------




security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 1767 (patched)
<https://reviews.apache.org/r/75359/#comment315521>

    Is this check necessary, given ensureAdminAndAuditAccessForPolicies() 
ensures that the user has admin privilege on the policies being deleted?



security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 1885 (patched)
<https://reviews.apache.org/r/75359/#comment315520>

    Is there a need to expose this method as a REST API? If not, I suggest 
moving this method (and other related new methods) to ServiceDBStore and have 
PublicAPIsv2.java directly call ServiceDBStore.



security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java
Lines 4494 (patched)
<https://reviews.apache.org/r/75359/#comment315519>

    Is it necessary to get RangerService object? I suggest replacing this 
method contents with the following:
    
    ```
    if (!policies.isEmpty()) {
      XXService xxService  = svcStore.getXXService().findByName(serviceName);
      
      if (xxService == null) {
        throw 
restErrorUtil.createRESTException(HttpServletResponse.SC_BAD_REQUEST, "service 
does not exist - name='" + serviceName, true);
      }
      
      ensureAdminAndAuditAccessForPolicies(policies, xxService, new 
HashMap<>(), serviceName);
    }
    ```


- Madhan Neethiraj


On March 4, 2025, 5:22 p.m., Guru Thejus Arveti wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75359/
> -----------------------------------------------------------
> 
> (Updated March 4, 2025, 5:22 p.m.)
> 
> 
> Review request for ranger.
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> API to delete multiple policies using a wildcard
> 
> 
> Diffs
> -----
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/store/AbstractPredicateUtil.java
>  b4d549df7 
>   agents-common/src/main/java/org/apache/ranger/plugin/util/SearchFilter.java 
> 5a5556a2f 
>   security-admin/src/main/java/org/apache/ranger/biz/ServiceDBStore.java 
> 7beef34c7 
>   security-admin/src/main/java/org/apache/ranger/common/RangerSearchUtil.java 
> 6833048e6 
>   security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java 
> 7b1eb7fe7 
>   security-admin/src/main/java/org/apache/ranger/rest/ServiceREST.java 
> f7c521111 
>   security-admin/src/test/java/org/apache/ranger/biz/TestServiceDBStore.java 
> 7747e327a 
> 
> 
> Diff: https://reviews.apache.org/r/75359/diff/4/
> 
> 
> Testing
> -------
> 
> Locally tested using docker by bulk creating ~10k policies and deleting them 
> by using the API. Time to execution ~25-30sec
> 
> 
> Thanks,
> 
> Guru Thejus Arveti
> 
>

Reply via email to