timifasubaa closed pull request #6206: make scheme level access control on csv
optional
URL: https://github.com/apache/incubator-superset/pull/6206
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/superset/config.py b/superset/config.py
index c94373969f..373df8d714 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -450,6 +450,10 @@ class CeleryConfig(object):
# using flask-compress
ENABLE_FLASK_COMPRESS = True
+# This determines if schema level access control will be enabled for
+# CSV upload.
+ENABLE_CSV_UPLOAD_SCHEMA_LEVEL_CONTROLS = True
+
try:
if CONFIG_PATH_ENV_VAR in os.environ:
# Explicitly import config module that is not in pythonpath; useful
diff --git a/superset/forms.py b/superset/forms.py
index e4b8481eda..934fdfb480 100644
--- a/superset/forms.py
+++ b/superset/forms.py
@@ -48,6 +48,9 @@ def csv_allowed_dbs():
csv_enabled_dbs = db.session.query(
models.Database).filter_by(
allow_csv_upload=True).all()
+ if not config.get('ENABLE_CSV_UPLOAD_SCHEMA_LEVEL_CONTROLS'):
+ return csv_enabled_dbs
+
for csv_enabled_db in csv_enabled_dbs:
if
CsvToDatabaseForm.at_least_one_schema_is_allowed(csv_enabled_db):
csv_allowed_dbs.append(csv_enabled_db)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]