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



Nikhil - plugins use RangerRolesUtil to find list of roles a user/group/role 
belongs to. Have you considered using this util? Here is an example:

  RangerRoles     roles     = ...; <== downloaded from 
RoleREST.getRangerRolesIfUpdated()
  RangerRolesUtil rolesUtil = new RangerRolesUtil(roles);
  
  Set<String> user1Roles  = rolesUtil.getUserRoleMapping().get("user1");
  Set<String> group1Roles = rolesUtil.getGroupRoleMapping().get("group1");
  Set<String> role1Roles  = rolesUtil.getRoleRoleMapping().get("role1");

- Madhan Neethiraj


On Dec. 8, 2022, 3:07 p.m., Nikhil P wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/74247/
> -----------------------------------------------------------
> 
> (Updated Dec. 8, 2022, 3:07 p.m.)
> 
> 
> Review request for ranger, Don Bosco Durai, Abhay Kulkarni, Madhan Neethiraj, 
> Mehul Parikh, Nikhil P, Pradeep Agrawal, Ramesh Mani, Selvamohan Neethiraj, 
> Sailaja Polavarapu, Subhrat Chaudhary, and Velmurugan Periasamy.
> 
> 
> Bugs: RANGER-4005
>     https://issues.apache.org/jira/browse/RANGER-4005
> 
> 
> Repository: ranger
> 
> 
> Description
> -------
> 
> Currently Role related API's does not provide functionality to provide the 
> list of roles in which given role is associated with.
> 
> For eg.If
> 
> ParentRole1 contains  containingRole1, containingRole2
> 
> ParentRole2 contains containingRole2
> 
> ParentRole3 contains containingRole1 ,containingRole3
> 
> .
> 
> .
> 
> .
> 
> ParentRole 1000
> 
> Now If I want to know containingRole1 is part of which Roles then I don't 
> have a direct way to know the list of roles in which containingRole1 is 
> present.
> 
>  
> 
> we need an API in RoleREST which can give the list of roles in which given 
> role is present.
> 
> we can pass the Rolename as containingRole1 to this API which will return us 
> the ParentRole1, ParentRole3.
> 
>  
> 
> API input output based on above data could be as follows,
> 
> Input                             Output
> 
> containingRole1           Role Object for ParentRole1, ParentRole3.
> 
> containingRole2           Role Object for ParentRole1, ParentRole2
> 
> containingRole3           Role Object for ParentRole3
> 
> 
> Diffs
> -----
> 
>   security-admin/src/main/java/org/apache/ranger/rest/PublicAPIsv2.java 
> c7a6ea0a6 
>   security-admin/src/main/java/org/apache/ranger/rest/RoleREST.java 4f0edd2b0 
>   security-admin/src/test/java/org/apache/ranger/rest/TestPublicAPIsv2.java 
> 2a123de93 
> 
> 
> Diff: https://reviews.apache.org/r/74247/diff/1/
> 
> 
> Testing
> -------
> 
> Added test cases to verify.
> Run the full build with test cases.
> 
> 
> Thanks,
> 
> Nikhil P
> 
>

Reply via email to