KannarFr commented on code in PR #17411:
URL: https://github.com/apache/pulsar/pull/17411#discussion_r962846141


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java:
##########
@@ -1080,102 +1077,126 @@ protected void handleSubscribe(final CommandSubscribe 
subscribe) {
                 }
                 Optional<Map<String, String>> subscriptionProperties = 
SubscriptionOption.getPropertiesMap(
                         subscribe.getSubscriptionPropertiesList());
-                service.getTopic(topicName.toString(), 
createTopicIfDoesNotExist)
-                        .thenCompose(optTopic -> {
-                            if (!optTopic.isPresent()) {
-                                return FutureUtil
-                                        .failedFuture(new 
TopicNotFoundException(
-                                                "Topic " + topicName + " does 
not exist"));
-                            }
 
-                            Topic topic = optTopic.get();
+                CompletableFuture<Boolean> isAuthorizedToCreateTopicFuture = 
isNamespaceOperationAllowed(
+                        topicName.getNamespaceObject(),
+                        NamespaceOperation.CREATE_TOPIC

Review Comment:
   This will prevent produce/consume of topic if it already exist but 
create_topic operation not authorized, nope?



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