nodece commented on code in PR #16792: URL: https://github.com/apache/pulsar/pull/16792#discussion_r937449050
########## pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java: ########## @@ -368,22 +359,12 @@ private CompletableFuture<Void> revokePermissionsAsync(String topicUri, String r protected void internalRevokePermissionsOnTopic(AsyncResponse asyncResponse, String role) { // This operation should be reading from zookeeper and it should be allowed without having admin privileges validateAdminAccessForTenantAsync(namespaceName.getTenant()) - .thenCompose(__ -> validatePoliciesReadOnlyAccessAsync().thenCompose(unused1 -> - getPartitionedTopicMetadataAsync(topicName, true, false) - .thenCompose(metadata -> { - int numPartitions = metadata.partitions; + .thenCompose(__ -> validatePoliciesReadOnlyAccessAsync().thenCompose(unused1 -> { CompletableFuture<Void> future = CompletableFuture.completedFuture(null); - if (numPartitions > 0) { - for (int i = 0; i < numPartitions; i++) { - TopicName topicNamePartition = topicName.getPartition(i); - future = future.thenComposeAsync(unused -> - revokePermissionsAsync(topicNamePartition.toString(), role)); - } - } - return future.thenComposeAsync(unused -> revokePermissionsAsync(topicName.toString(), role)) + return future.thenComposeAsync(unused -> Review Comment: ```suggestion return revokePermissionsAsync(topicName.getPartitionedTopicName(), role) ``` -- 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: commits-unsubscr...@pulsar.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org