Technoboy- commented on code in PR #23372:
URL: https://github.com/apache/pulsar/pull/23372#discussion_r1794452356
##########
pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java:
##########
@@ -251,6 +254,68 @@ public CompletableFuture<Void>
grantPermissionAsync(TopicName topicName, Set<Aut
});
}
+ public CompletableFuture<Void>
grantPermissionAsync(List<GrantTopicPermissionOptions> options) {
+ 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");
+ }
+ TopicName topicName = TopicName.get(options.get(0).getTopic());
+ return pulsarResources.getNamespaceResources()
+ .setPoliciesAsync(topicName.getNamespaceObject(), policies
-> {
Review Comment:
https://github.com/apache/pulsar/pull/23372/files#r1794452230
@lhotari
--
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]