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


##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/AuthorizationProvider.java:
##########
@@ -428,4 +429,48 @@ default Boolean allowTopicPolicyOperation(TopicName 
topicName,
             throw new RestException(e.getCause());
         }
     }
+
+    /**
+     * Remove authorization-action permissions on a topic to the given client.
+     * @param topicName
+     * @return CompletableFuture<Void>
+     */
+    default CompletableFuture<Void> removePermissionsAsync(TopicName 
topicName) {
+        return FutureUtil.failedFuture(new IllegalStateException(
+                String.format("removePermissionsAsync on topicName %s is not 
supported by the Authorization",
+                        topicName)));
+    }
+
+    /**
+     * Get authorization-action permissions on a topic to the given client.
+     * @param topicName
+     * @return CompletableFuture<Map<String, Set<AuthAction>>>
+     */
+    default CompletableFuture<Map<String, Set<AuthAction>>> 
getPermissionsAsync(TopicName topicName) {

Review Comment:
   Currently, my design and implementation are simple. It's only for Admin API 
usage.
   For this `getPermissionsAsync`, it's only used for `getPermissionsOnTopic` 
in Admin
   If we change `getPermissionsAsync(TopicName topicName, String role)`, I 
think it's really match other methods in the AuthorizationProvider, but we 
don't need it right now.
   



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