vyommani commented on code in PR #1347:
URL: https://github.com/apache/ranger/pull/1347#discussion_r4450540491


##########
security-admin/src/main/java/org/apache/ranger/db/XXServiceDao.java:
##########
@@ -17,6 +17,7 @@
 
 package org.apache.ranger.db;
 
+import org.apache.commons.lang.StringUtils;

Review Comment:
   please use 'org.apache.commons.lang3.StringUtils' instead



##########
security-admin/src/main/java/org/apache/ranger/db/XXServiceDao.java:
##########
@@ -177,7 +179,19 @@ public List<RangerServiceHeaderInfo> findServiceHeaders() {
             ret = new ArrayList<>(results.size());
 
             for (Object[] result : results) {
-                ret.add(new RangerServiceHeaderInfo((Long) result[0], (String) 
result[1], (String) result[2], (String) result[3], (Boolean) result[4]));
+                RangerServiceHeaderInfo svcHeader   = new 
RangerServiceHeaderInfo((Long) result[0], (String) result[1], (String) 
result[2], (String) result[3], (Boolean) result[4]);
+                String                  adminUsers  = (String) result[5];
+                String                  adminGroups = (String) result[6];
+
+                if (StringUtils.isNotBlank(adminUsers)) {
+                    
svcHeader.setAdminUsers(Arrays.asList(adminUsers.split(",")));

Review Comment:
   Any logged-in user can now see who the admins are. getServiceHeaders keeps a 
header when hasAccess is true, and that lets any ROLE_USER read non-KMS service 
headers. Before this change, seeing a service's admin users and groups required 
config access. If this wider visibility is intended, the PR should say so. 
Otherwise the new fields should be gated.



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