tuteng commented on a change in pull request #5767: Support batch authorization 
of partitioned topic
URL: https://github.com/apache/pulsar/pull/5767#discussion_r353164610
 
 

 ##########
 File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java
 ##########
 @@ -301,13 +295,29 @@ protected void internalGrantPermissionsOnTopic(String 
role, Set<AuthAction> acti
             log.warn("[{}] Failed to grant permissions on topic {}: concurrent 
modification", clientAppId(),
                     topicUri);
             throw new RestException(Status.CONFLICT, "Concurrent 
modification");
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             log.error("[{}] Failed to grant permissions for topic {}", 
clientAppId(), topicUri, e);
             throw new RestException(e);
         }
     }
 
+    protected void internalGrantPermissionsOnTopic(String role, 
Set<AuthAction> actions) {
+        // This operation should be reading from zookeeper and it should be 
allowed without having admin privileges
+        validateAdminAccessForTenant(namespaceName.getTenant());
+        validatePoliciesReadOnlyAccess();
+
+        PartitionedTopicMetadata meta = getPartitionedTopicMetadata(topicName, 
true, false);
 
 Review comment:
   You are right. But one unit test never passed:
   
   You can test it locally:
   
   ```
   mvn test -Dtest=org.apache.pulsar.broker.admin.AdminTest#persistentTopics 
-pl pulsar-broker
   
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to