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

Review request for ranger, Ankita Sinha, Dhaval Shah, Dineshkumar Yadav, Gautam 
Borad, Jayendra Parab, Kishor Gollapalliwar, Abhay Kulkarni, Madhan Neethiraj, 
Mehul Parikh, Nitin Galave, Nixon Rodrigues, Ramesh Mani, Sailaja Polavarapu, 
and Velmurugan Periasamy.


Bugs: RANGER-2739
    https://issues.apache.org/jira/browse/RANGER-2739


Repository: ranger


Description
-------

**Problem Statement:** In Ranger there is no API which can return all the 
groups and its users mapping. 

**Proposed Solution:** Proposed patch fetches all the existing users and calls 
existing method which returns the mapping of each group. API collects each 
group users in a list and returns List<VXGroupUserInfo> object.


Diffs
-----

  security-admin/src/main/java/org/apache/ranger/biz/XUserMgr.java bfce9a63f 
  security-admin/src/main/java/org/apache/ranger/rest/XUserREST.java af80639ec 


Diff: https://reviews.apache.org/r/72160/diff/1/


Testing
-------

Build ranger admin with patch, installed and started it.

**Sample curl request:**
curl -i -X GET --header "Accept:application/json" -H "Content-Type: 
application/json" -u admin:admin123  
'http://localhost:6080/service/xusers/groupusers/details'

**JSON Response:** 
[{"createDate":null,"updateDate":null,"xgroupInfo":{"id":1,"createDate":"2020-02-20T07:08:38Z","updateDate":"2020-02-20T07:08:38Z","owner":"Admin","updatedBy":"Admin","name":"public","description":"public
 
group","groupType":0,"groupSource":0,"isVisible":1},"xuserInfo":[]},{"createDate":null,"updateDate":null,"xgroupInfo":{"id":2,"createDate":"2020-02-22T08:57:39Z","updateDate":"2020-02-22T08:57:39Z","owner":"Admin","updatedBy":"Admin","name":"group1","description":"","groupType":0,"groupSource":0,"isVisible":1},"xuserInfo":[{"createDate":null,"updateDate":null,"name":"testuser2","status":0,"isVisible":1,"userSource":0,"userRoleList":["ROLE_USER"]},{"createDate":null,"updateDate":null,"name":"testuser1","status":0,"isVisible":1,"userSource":0,"userRoleList":["ROLE_USER"]}]},{"createDate":null,"updateDate":null,"xgroupInfo":{"id":3,"createDate":"2020-02-22T08:57:48Z","updateDate":"2020-02-22T08:57:48Z","owner":"Admin","updatedBy":"Admin","name":"group2","description"
 
:"","groupType":0,"groupSource":0,"isVisible":1},"xuserInfo":[{"createDate":null,"updateDate":null,"name":"testuser3","status":0,"isVisible":1,"userSource":0,"userRoleList":["ROLE_USER"]},{"createDate":null,"updateDate":null,"name":"testuser4","status":0,"isVisible":1,"userSource":0,"userRoleList":["ROLE_USER"]}]}]

**Note:** Performance testing is not done with this patch.


Thanks,

Pradeep Agrawal

Reply via email to