From 4116b7776b277e0e21844300f3618ffb1243e300 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Sat, 27 Mar 2021 16:21:06 +0530 Subject: [PATCH] Add enterprise API tag to allowed tags --- .../apimgt/application/extension/api/util/APIUtil.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java index 43490e0c831..014a59b9c5c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java @@ -48,6 +48,7 @@ public class APIUtil { private static final String DEFAULT_APP_MGT_SUB_MGT_TAG = "subscription_management"; private static final String DEFAULT_ANALYTICS_ARTIFACT_TAG = "analytics_artifacts_management"; private static final String DEFAULT_TRANSPORT_MGT_TAG = "transport_management"; + private static final String DEFAULT_ENTERPRISE_TAG= "androidforwork"; public static final String PERMISSION_PROPERTY_NAME = "name"; @@ -118,6 +119,11 @@ public class APIUtil { allowedApisTags.add(DEFAULT_APP_MGT_SUB_MGT_TAG); allowedApisTags.add(DEFAULT_ANALYTICS_ARTIFACT_TAG); allowedApisTags.add(DEFAULT_TRANSPORT_MGT_TAG); + // In an environment only super tenant should be capable of calling this API tag + if (PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId() == + MultitenantConstants.SUPER_TENANT_ID) { + allowedApisTags.add(DEFAULT_ENTERPRISE_TAG); + } return allowedApisTags; }