etr2460 commented on a change in pull request #8455: [Datasource Editor] A few 
small UI changes in modal to prevent accidental edits
URL: 
https://github.com/apache/incubator-superset/pull/8455#discussion_r339730494
 
 

 ##########
 File path: superset/views/core.py
 ##########
 @@ -1221,10 +1221,14 @@ def explore(self, datasource_type=None, 
datasource_id=None):
             )
 
         standalone = request.args.get("standalone") == "true"
+        user_roles = [role.name.lower() for role in get_user_roles()]
+        is_admin_role = "admin" in user_roles
         bootstrap_data = {
             "can_add": slice_add_perm,
             "can_download": slice_download_perm,
             "can_overwrite": slice_overwrite_perm,
+            "can_overwrite_datasource": is_admin_role
 
 Review comment:
   discussed offline and agreed that this disabling should apply to all 
datasources, and also disable the SQL field if you're not the creator of the 
datasource

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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]

Reply via email to