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


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:
##########
@@ -641,4 +643,131 @@ public CompletableFuture<Boolean> 
validateTenantAdminAccess(String tenantName, S
                 });
     }
 
+    @Override
+    public CompletableFuture<Void> removePermissionsAsync(TopicName topicName) 
{
+        return getPoliciesReadOnlyAsync().thenCompose(readonly -> {
+            if (readonly) {
+                if (log.isDebugEnabled()) {
+                    log.debug("Policies are read-only. Broker cannot do 
read-write operations");
+                }
+                throw new IllegalStateException("policies are in readonly 
mode");
+            }
+            return 
pulsarResources.getNamespaceResources().getPoliciesAsync(topicName.getNamespaceObject())
+                    .thenCompose(policies -> {
+                        if (!policies.isPresent()
+                                || 
!policies.get().auth_policies.getTopicAuthentication()

Review Comment:
   It won't, see 
https://github.com/apache/pulsar/blob/4586852f30902b5247d907ce4cc9360152db1e21/pulsar-client-admin-api/src/main/java/org/apache/pulsar/common/policies/data/Policies.java#L33-L37



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