You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "Technoboy- (via GitHub)" <gi...@apache.org> on 2023/06/04 00:56:19 UTC

[GitHub] [pulsar] Technoboy- commented on a diff in pull request #20478: [improve][admin] Using AuthorizationService to revoke the permissions.

Technoboy- commented on code in PR #20478:
URL: https://github.com/apache/pulsar/pull/20478#discussion_r1216004548


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:
##########
@@ -263,7 +263,10 @@ public CompletableFuture<Void> revokePermissionAsync(TopicName topicName, String
                         policies.auth_policies.getTopicAuthentication()
                                 .computeIfPresent(topicName.toString(), (k, v) -> {
                                         v.remove(role);
-                                        return null;
+                                        if (v.isEmpty()) {
+                                            return  null;
+                                        }
+                                        return v;

Review Comment:
   I have added some tests for this. you can see the modification in `AuthorizationProducerConsumerTest.java`



-- 
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-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org