mneethiraj commented on code in PR #580:
URL: https://github.com/apache/ranger/pull/580#discussion_r2651826394


##########
agents-common/src/main/java/org/apache/ranger/plugin/util/SearchFilter.java:
##########
@@ -74,6 +74,8 @@ public class SearchFilter {
     public static final String ZONE_NAME_PREFIX         = "zoneNamePrefix";    
   // search
     public static final String POLICY_NAME_PREFIX       = "policyNamePrefix";
 
+    public static final String ASSOCIATED_ROLE_NAME_PARTIAL = 
"associatedRoleNamePartial";   // search

Review Comment:
   @RakeshGuptaDev  - instead of introdcing new seach parameter 
`associatedRoleNamePartial`, I suggest updating `RoleDBStore.getRolesForUser()` 
to call `roles = getRoles(filter);` for admin users i.e. as shown below. This 
will result in consistent handling of role name filter.
   
   ```
   public RangerRoleList getRolesForUser(SearchFilter filter, RangerRoleList 
rangerRoleList) {
     List<RangerRole> roles       = new ArrayList<>();
     ...
     if (userSession != null && userSession.getUserRoleList().size() == 1 && 
userSession.getUserRoleList().contains(RangerConstants.ROLE_USER) && 
userSession.getLoginId() != null) {
       ...
     } else {
       roles = getRoles(filter)
     }
     ...
   }
   ```
   
   Please make sure to handle pagination parameters appropriately.



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

Reply via email to