You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2020/07/17 23:41:21 UTC
[GitHub] [pulsar] srkukarni commented on a change in pull request #7587: Use Consume/Produce/Lookup interfaces for specific operations in allowTopicOperation
srkukarni commented on a change in pull request #7587:
URL: https://github.com/apache/pulsar/pull/7587#discussion_r456716203
##########
File path: pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationService.java
##########
@@ -486,7 +486,16 @@ public Boolean allowNamespacePolicyOperation(NamespaceName namespaceName, Policy
}
if (provider != null) {
- return provider.allowTopicOperationAsync(topicName, originalRole, role, operation, authData);
+ switch (operation) {
+ case PRODUCE:
+ return canProduceAsync(topicName, role, authData);
+ case CONSUME:
+ return canConsumeAsync(topicName, role, authData, null);
+ case LOOKUP:
+ return canLookupAsync(topicName, role, authData);
+ default:
+ return provider.allowTopicOperationAsync(topicName, originalRole, role, operation, authData);
Review comment:
@sijie Done. PTAL
----------------------------------------------------------------
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:
users@infra.apache.org