Skip to content

Commit

Permalink
support new routes (apache#7900)
Browse files Browse the repository at this point in the history
  • Loading branch information
KannarFr authored May 6, 2021
1 parent fdbc5b2 commit bd4dcd3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ protected void internalSetNamespaceMessageTTL(Integer messageTTL) {
}

protected void internalSetSubscriptionExpirationTime(int expirationTime) {
validateAdminAccessForTenant(namespaceName.getTenant());
validateNamespacePolicyOperation(namespaceName, PolicyName.SUBSCRIPTION_EXPIRATION_TIME, PolicyOperation.WRITE);
validatePoliciesReadOnlyAccess();

if (expirationTime < 0) {
Expand All @@ -791,7 +791,7 @@ protected void internalSetSubscriptionExpirationTime(int expirationTime) {
protected void internalSetAutoTopicCreation(AsyncResponse asyncResponse,
AutoTopicCreationOverride autoTopicCreationOverride) {
final int maxPartitions = pulsar().getConfig().getMaxNumPartitionsPerPartitionedTopic();
validateAdminAccessForTenant(namespaceName.getTenant());
validateNamespacePolicyOperation(namespaceName, PolicyName.AUTO_TOPIC_CREATION, PolicyOperation.WRITE);
validatePoliciesReadOnlyAccess();
if (autoTopicCreationOverride != null) {
if (!AutoTopicCreationOverride.isValidOverride(autoTopicCreationOverride)) {
Expand Down Expand Up @@ -831,8 +831,8 @@ protected void internalRemoveAutoTopicCreation(AsyncResponse asyncResponse) {
}

protected void internalSetAutoSubscriptionCreation(
AsyncResponse asyncResponse, AutoSubscriptionCreationOverride autoSubscriptionCreationOverride) {
validateAdminAccessForTenant(namespaceName.getTenant());
AsyncResponse asyncResponse, AutoSubscriptionCreationOverride autoSubscriptionCreationOverride) {
validateNamespacePolicyOperation(namespaceName, PolicyName.AUTO_SUBSCRIPTION_CREATION, PolicyOperation.WRITE);
validatePoliciesReadOnlyAccess();

// Force to read the data s.t. the watch to the cache content is setup.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
public enum PolicyName {
ALL,
ANTI_AFFINITY,
AUTO_SUBSCRIPTION_CREATION,
AUTO_TOPIC_CREATION,
BACKLOG,
COMPACTION,
DELAYED_DELIVERY,
Expand All @@ -43,6 +45,7 @@ public enum PolicyName {
REPLICATION_RATE,
SCHEMA_COMPATIBILITY_STRATEGY,
SUBSCRIPTION_AUTH_MODE,
SUBSCRIPTION_EXPIRATION_TIME,
ENCRYPTION,
TTL,
MAX_TOPICS,
Expand Down

0 comments on commit bd4dcd3

Please sign in to comment.