You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2019/02/07 19:28:32 UTC

[GitHub] john-bodley commented on a change in pull request #5787: Add schema level access control on csv upload

john-bodley commented on a change in pull request #5787: Add schema level access control on csv upload
URL: https://github.com/apache/incubator-superset/pull/5787#discussion_r254834838
 
 

 ##########
 File path: superset/utils.py
 ##########
 @@ -844,6 +844,7 @@ def get_or_create_main_db():
     dbobj.set_sqlalchemy_uri(conf.get('SQLALCHEMY_DATABASE_URI'))
     dbobj.expose_in_sqllab = True
     dbobj.allow_run_sync = True
+    dbobj.allow_csv_upload = True
 
 Review comment:
   @youngyjd why is this explicitly set? Note in general one would not want to have users upload to the `main` database. Secondly if you disable this setting in the UI then every time the app is restarted the database record is updated. 
   
   @mistercrunch personally I don't think we should be setting any of these fields if the `dbobj` exists, i.e., I feel the logic should be:
   ```
   if not dbobj:
       dbobj = models.Database(database_name='main')
       dbobj.set_sqlalchemy_uri(conf.get('SQLALCHEMY_DATABASE_URI'))
       dbobj.expose_in_sqllab = False
       dbobj.allow_run_sync = False
       dbobj.allow_csv_upload = False
   ```
   i.e., all these settings should be initialized as `False` and never updated.
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org