Skip to content

Commit

Permalink
Config programmatic roles in the config.py (#1664)
Browse files Browse the repository at this point in the history
* Config programmatic roles in the config.py,

* Add sql_lab.
  • Loading branch information
bkyryliuk authored Nov 29, 2016
1 parent 1c429b2 commit c07f0ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ class CeleryConfig(object):
# 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')
Expand Down
2 changes: 1 addition & 1 deletion superset/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c07f0ab

Please sign in to comment.