[DISCUSS] Improve Permission Control for Subscription.
- Dominant language
- Java
- Stars
- 15.3k
- Forks
- 3.8k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 160
Description
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Motivation
The concept of group in Kafka is independent of the topic, while Pulsar's group/subscription is a concept under the topic. Every `Subscription` corresponds to only one topic.
```
public class PersistentSubscription extends AbstractSubscription implements Subscription {
protected final PersistentTopic topic;
protected final ManagedCursor cursor;
protected final String topicName;
protected final String subName;
```
But when doing permission control, the subscriptions belongs to the namespace instead of topic. Subscriptions with same name in the same namespace, but from different topics are treated as one subscription for permission control, and the role list is saved on zk under the path `/admin/policies/tenant/namespace`.
### Solution
Move the role list for subscription to topic policy, so that the permission control for subscription is topic specific.
### Alternatives
_No response_
### Anything else?
_No response_
### Are you willing to submit a PR?
- [X] I'm willing to submit a PR!
Contributor guide
Assessment
This issue has not been assessed yet.