Skip to content

Commit

Permalink
Add in feature flag remove-premium-restrictions (#1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
seeker25 authored Oct 29, 2024
1 parent ed6363b commit 6aa9188
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pay-api/src/pay_api/services/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ def check_auth(
if required_roles := kwargs.get("all_of_roles", None):
is_authorized = len(set(required_roles) & set(roles)) == len(set(required_roles))
# Check if premium flag is required
if kwargs.get("is_premium", False) and auth_response["account"]["accountType"] not in PREMIUM_ACCOUNT_TYPES:
if (
flags.is_on("remove-premium-restrictions", default=False) is False
and kwargs.get("is_premium", False)
and auth_response["account"]["accountType"] not in PREMIUM_ACCOUNT_TYPES
):
is_authorized = False
# For staff users, if the account is coming as empty add stub data
# (businesses which are not affiliated won't have account)
Expand Down

0 comments on commit 6aa9188

Please sign in to comment.