You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
379 B

# TODO: this is not used for the moment because it should be used in routes file but it breaks reloading.
class Carto::FeatureFlagConstraint
def initialize(feature_flag)
@feature_flag = feature_flag
end
def matches?(request)
user = Carto::User.where(username: CartoDB.extract_subdomain(request)).first
user && user.has_feature_flag?(@feature_flag)
end
end