From 08a6a876c359443cd7ac02eaeee8a31d6d1e2360 Mon Sep 17 00:00:00 2001 From: chashikajw Date: Thu, 16 May 2024 17:29:36 +0530 Subject: [PATCH 1/2] Fix incorrect subscription tier availability issue --- .../org/wso2/carbon/apimgt/impl/APIConsumerImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java index 94d8ea24d00f..e4c2c6e7f326 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java +++ b/components/apimgt/org.wso2.carbon.apimgt.impl/src/main/java/org/wso2/carbon/apimgt/impl/APIConsumerImpl.java @@ -865,7 +865,7 @@ public SubscriptionResponse addSubscription(ApiTypeWrapper apiTypeWrapper, Strin WorkflowResponse workflowResponse = null; String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(userId); - checkSubscriptionAllowed(apiTypeWrapper); + checkSubscriptionAllowed(apiTypeWrapper, apiTypeWrapper.getTier()); int subscriptionId; if (APIConstants.PUBLISHED.equals(state) || APIConstants.PROTOTYPED.equals(state)) { subscriptionId = apiMgtDAO.addSubscription(apiTypeWrapper, application, @@ -1056,7 +1056,7 @@ public SubscriptionResponse updateSubscription(ApiTypeWrapper apiTypeWrapper, St apiContext = api.getContext(); apiOrgId = api.getOrganization(); } - checkSubscriptionAllowed(apiTypeWrapper); + checkSubscriptionAllowed(apiTypeWrapper, requestedThrottlingPolicy); WorkflowResponse workflowResponse = null; int subscriptionId; if (APIConstants.PUBLISHED.equals(state) || APIConstants.PROTOTYPED.equals(state)) { @@ -4434,7 +4434,7 @@ private Map getHostWithSchemeMappingForLabelWS(List