Skip to content

Commit

Permalink
Merge pull request #1906 from akto-api-security/feature/fix_rbac_feat…
Browse files Browse the repository at this point in the history
…ure_access

Handling role in interceptor
  • Loading branch information
notshivansh authored Jan 3, 2025
2 parents a6e0493 + fd6f68d commit 9c4c90b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static Set<Integer> 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<Integer, Integer> lastDeactivatedFetchedMap = new HashMap<>();
private static final int REFRESH_INTERVAL = 60 * 2; // 2 minutes.
private static final int REFRESH_INTERVAL_RBAC = 60 * 60; // 1 hour.
Expand Down Expand Up @@ -75,7 +76,8 @@ private static boolean checkForPaidFeature(int accountId){

HashMap<String, FeatureAccess> 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){
Expand Down

0 comments on commit 9c4c90b

Please sign in to comment.