michaeljmarshall commented on code in PR #20478:
URL: https://github.com/apache/pulsar/pull/20478#discussion_r1218537853


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java:
##########
@@ -319,59 +319,25 @@ protected void internalGrantPermissionsOnTopic(final 
AsyncResponse asyncResponse
                 });
     }
 
-    private CompletableFuture<Void> revokePermissionsAsync(String topicUri, 
String role, boolean force) {
-        return 
namespaceResources().getPoliciesAsync(namespaceName).thenCompose(
-                policiesOptional -> {
-                    Policies policies = policiesOptional.orElseThrow(() ->
-                            new RestException(Status.NOT_FOUND, "Namespace 
does not exist"));
-                    if 
(!policies.auth_policies.getTopicAuthentication().containsKey(topicUri)
-                            || 
!policies.auth_policies.getTopicAuthentication().get(topicUri).containsKey(role))
 {
-                        log.warn("[{}] Failed to revoke permission from role 
{} on topic: Not set at topic level {}",
-                                clientAppId(), role, topicUri);
-                        if (force) {
-                            return CompletableFuture.completedFuture(null);
-                        } else {
-                            return FutureUtil.failedFuture(new 
RestException(Status.PRECONDITION_FAILED,
-                                    "Permissions are not set at the topic 
level"));
-                        }
-                    }

Review Comment:
   Makes sense. I thought the `force` argument was part of the API, but it's 
not. While this precondition check is certainly part of pulsar's behavior, it 
is not done consistently, so I think it is fine to remove.



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