janhoy commented on a change in pull request #372:
URL: https://github.com/apache/solr/pull/372#discussion_r742993915



##########
File path: solr/core/src/java/org/apache/solr/handler/admin/InfoHandler.java
##########
@@ -157,4 +158,17 @@ public SolrRequestHandler getSubHandler(String subPath) {
   public Boolean registerV2() {
     return Boolean.TRUE;
   }
+
+  @Override
+  public Name getPermissionName(AuthorizationContext request) {
+    // Delegate permission to the actual handler
+    String path = request.getResource();
+    String lastPath = path.substring(path.lastIndexOf("/") +1 );
+    RequestHandlerBase handler = 
handlers.get(lastPath.toLowerCase(Locale.ROOT));
+    if (handler != null) {
+      return handler.getPermissionName(request);
+    } else {
+      return null;

Review comment:
       Not entirely sure what to do in case the path is unknown, e.g 
`/admin/info/foo`. Shoudl we return `null`, `ALL` or throw an exception? 
@noblepaul is this correct use of 'null'? Since the handler does not exist, the 
handleRequest() call will likely return an error anyway, so it does not really 
matter what we do here.




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