diff --git a/superset/config.py b/superset/config.py index 8a85d14cd5da..630fbef9030a 100644 --- a/superset/config.py +++ b/superset/config.py @@ -301,10 +301,11 @@ def _try_json_readsha(filepath, length): # pylint: disable=unused-argument # role-based features, or a full on A/B testing framework. # # from flask import g, request -# def GET_FEATURE_FLAGS_FUNC(feature_flags_dict): -# feature_flags_dict['some_feature'] = g.user and g.user.id == 5 +# def GET_FEATURE_FLAGS_FUNC(feature_flags_dict: Dict[str, bool]) -> Dict[str, bool]: +# if hasattr(g, "user") and g.user.is_active: +# feature_flags_dict['some_feature'] = g.user and g.user.id == 5 # return feature_flags_dict -GET_FEATURE_FLAGS_FUNC = None +GET_FEATURE_FLAGS_FUNC: Optional[Callable[[Dict[str, bool]], Dict[str, bool]]] = None # ---------------------------------------------------