From fd6f68d6f4e60302458f8c1369ebee135716eaf8 Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Fri, 3 Jan 2025 16:38:34 +0530 Subject: [PATCH] Handling role in interceptor --- .../src/main/java/com/akto/usage/UsageMetricCalculator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/utils/src/main/java/com/akto/usage/UsageMetricCalculator.java b/libs/utils/src/main/java/com/akto/usage/UsageMetricCalculator.java index a45977bf47..b561a2637d 100644 --- a/libs/utils/src/main/java/com/akto/usage/UsageMetricCalculator.java +++ b/libs/utils/src/main/java/com/akto/usage/UsageMetricCalculator.java @@ -47,6 +47,7 @@ public static Set getDemos() { * to handle multiple accounts using static maps. */ private final static String FEATURE_LABEL_STRING = "RBAC_FEATURE"; + private final static String BASIC_RBAC_FEATURE = "RBAC_BASIC"; private static Map lastDeactivatedFetchedMap = new HashMap<>(); private static final int REFRESH_INTERVAL = 60 * 2; // 2 minutes. private static final int REFRESH_INTERVAL_RBAC = 60 * 60; // 1 hour. @@ -75,7 +76,8 @@ private static boolean checkForPaidFeature(int accountId){ HashMap featureWiseAllowed = organization.getFeatureWiseAllowed(); FeatureAccess featureAccess = featureWiseAllowed.getOrDefault(FEATURE_LABEL_STRING, FeatureAccess.noAccess); - return featureAccess.getIsGranted(); + FeatureAccess basicAccess = featureWiseAllowed.getOrDefault(BASIC_RBAC_FEATURE, FeatureAccess.noAccess); + return featureAccess.getIsGranted() || basicAccess.getIsGranted(); } public static boolean isRbacFeatureAvailable(int accountId){