mirror of
https://github.com/apache/superset.git
synced 2026-04-25 11:04:48 +00:00
Allow for dynamic feature flags (#6808)
* Allow for dynamic feature flags Giving more control over feature flags, allowing administrator to define custom logic around whether features are enabled for particular users / roles. The exposed function can be used for things like: * progressive rollout of features (1%, 5%, 50%, 100%) * experimentation * role-based feature affectation (only admins see a particular feature) * fix build * Addressing comments * Addressing @hughhh's comments
This commit is contained in:
committed by
GitHub
parent
e0feec9117
commit
3ae02d1a54
@@ -190,10 +190,14 @@ class SupersetTestCase(unittest.TestCase):
|
||||
raise Exception('run_sql failed')
|
||||
return resp
|
||||
|
||||
@patch.dict('superset.feature_flags', {'FOO': True}, clear=True)
|
||||
@patch.dict('superset._feature_flags', {'FOO': True}, clear=True)
|
||||
def test_existing_feature_flags(self):
|
||||
self.assertTrue(is_feature_enabled('FOO'))
|
||||
|
||||
@patch.dict('superset.feature_flags', {}, clear=True)
|
||||
@patch.dict('superset._feature_flags', {}, clear=True)
|
||||
def test_nonexistent_feature_flags(self):
|
||||
self.assertFalse(is_feature_enabled('FOO'))
|
||||
|
||||
def test_feature_flags(self):
|
||||
self.assertEquals(is_feature_enabled('foo'), 'bar')
|
||||
self.assertEquals(is_feature_enabled('super'), 'set')
|
||||
|
||||
Reference in New Issue
Block a user