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




agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java
Line 441 (original), 441 (patched)
<https://reviews.apache.org/r/75051/#comment314829>

    Anand - instead of creating a HashMap in every RangerPolicy object, 
consider updating RangerPolicyServiceBase.mapViewToEntityBean() to something 
like:
    
      String              validitySchedules = 
JsonUtils.listToJson(vObj.getValiditySchedules());
      Map<String, Object> options           = vObj.getOptions();
    
      if (StringUtils.isNotBlank(validitySchedules)) {
        options = vObj.getUpdatableMap(options);
    
        options.put(OPTION_POLICY_VALIDITY_SCHEDULES, validitySchedules);
      } else if (MapUtils.isNotEmpty(options)) {
        options.remove(OPTION_POLICY_VALIDITY_SCHEDULES);
      }
    
      xObj.setOptions(JsonUtils.mapToJson(options));


- Madhan Neethiraj


On June 17, 2024, 9:28 a.m., Anand Nadar wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75051/
> -----------------------------------------------------------
> 
> (Updated June 17, 2024, 9:28 a.m.)
> 
> 
> Review request for ranger, Asit Vadhavkar, Madhan Neethiraj, Monika 
> Kachhadiya, Siddhesh Phatak, and Subhrat Chaudhary.
> 
> 
> Bugs: https://issues.apache.org/jira/browse/RANGER-4822
>     
> https://issues.apache.org/jira/browse/https://issues.apache.org/jira/browse/RANGER-4822
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Initialising RangerPolicy.options to a modifiable HashMap since it is being 
> modified when validity period is being added
> 
> 
> Diffs
> -----
> 
>   
> agents-common/src/main/java/org/apache/ranger/plugin/model/RangerPolicy.java 
> 28fd2ca6c 
> 
> 
> Diff: https://reviews.apache.org/r/75051/diff/1/
> 
> 
> Testing
> -------
> 
> Validated policy creation and updation
> 
> 
> Thanks,
> 
> Anand Nadar
> 
>

Reply via email to