dragonls commented on issue #10300:
URL: https://github.com/apache/pulsar/issues/10300#issuecomment-824800393


   There are 2 ways to solve this bug:
   1. After updating the partition num of the topic, try to regrant the 
permissions of the topic. It is to say that in the end of 
[`org.apache.pulsar.broker.admin.impl.PersistentTopicsBase#updatePartitionedTopic`](https://github.com/apache/pulsar/blob/master/pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/PersistentTopicsBase.java#L3446)
 , try to get the topic level permissions of the topic and regrant them by 
calling `internalGrantPermissionsOnTopic`.
   2. In 
[`org.apache.pulsar.broker.authorization.PulsarAuthorizationProvider#checkPermission`](https://github.com/apache/pulsar/blob/889b9b8e5efc62d2d0cbc761205fba5759c97af0/pulsar-broker-common/src/main/java/org/apache/pulsar/broker/authorization/PulsarAuthorizationProvider.java#L394)
 , for example, if the topic is a sub-partitioned topic 
`persistent://test/auth/topic-partition-4` of the partitioned topic 
`persistent://test/auth/topic`, try to check the permission of  
`persistent://test/auth/topic` again.
   
   I can not tell which solution is better.
   I prefer the first solution but that may change the permissions of previous 
sub-partitioned topics.


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to