janhoy commented on code in PR #1359:
URL: https://github.com/apache/solr/pull/1359#discussion_r1106858436


##########
solr/core/src/java/org/apache/solr/handler/admin/SystemInfoHandler.java:
##########
@@ -339,7 +341,10 @@ public SimpleOrderedMap<Object> 
getSecurityInfo(SolrQueryRequest req) {
         RuleBasedAuthorizationPluginBase rbap = 
(RuleBasedAuthorizationPluginBase) auth;
         Set<String> roles = rbap.getUserRoles(req.getUserPrincipal());
         info.add("roles", roles);
-        info.add("permissions", rbap.getPermissionNamesForRoles(roles));
+        info.add(
+            "permissions",
+            rbap.getPermissionNamesForRoles(
+                Stream.concat(roles.stream(), Stream.of("*", 
null)).collect(Collectors.toSet())));

Review Comment:
   I considered letting `getPermissionNamesForRoles` always consider `*` and 
`null` roles, since this is the only place it is used, but the name of the 
method suggests that you want permissions for exactly those roles, so I left it 
generic and instead expanded on the JavaDoc for the method and appended the two 
special roles on the caller side...



-- 
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: issues-unsubscr...@solr.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to