Config programmatic roles in the config.py (#1664)

* Config programmatic roles in the config.py,

* Add sql_lab.
This commit is contained in:
Bogdan 2016-11-28 19:29:30 -05:00 committed by GitHub
parent 1c429b27bc
commit c07f0ab9c7
2 changed files with 5 additions and 1 deletions

View File

@ -244,6 +244,10 @@ RESULTS_BACKEND = None
# dictionary.
JINJA_CONTEXT_ADDONS = {}
# Roles that are controlled by the API / Superset and should not be changes
# by humans.
ROBOT_PERMISSION_ROLES = ['Public', 'Gamma', 'Alpha', 'Admin', 'sql_lab']
try:
from superset_config import * # noqa
print('Loaded your LOCAL configuration')

View File

@ -2561,7 +2561,7 @@ class DatasourceAccessRequest(Model, AuditMixinNullable):
datasource_id = Column(Integer)
datasource_type = Column(String(200))
ROLES_BLACKLIST = set(['Admin', 'Alpha', 'Gamma', 'Public'])
ROLES_BLACKLIST = set(config.get('ROBOT_PERMISSION_ROLES', []))
@property
def cls_model(self):