superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: check for access before requesting access (#4469)
Date Wed, 28 Feb 2018 01:43:41 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 8626793  check for access before requesting access (#4469)
8626793 is described below

commit 8626793655e2d0ecf9896d0f214f962dc20e4665
Author: timifasubaa <30888507+timifasubaa@users.noreply.github.com>
AuthorDate: Tue Feb 27 17:43:37 2018 -0800

    check for access before requesting access (#4469)
---
 superset/views/core.py | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/superset/views/core.py b/superset/views/core.py
index c8101b8..5b0ee5f 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -842,6 +842,15 @@ class Superset(BaseSupersetView):
                 .one()
             )
             datasources.add(datasource)
+
+        has_access = all(
+            (
+                datasource and self.datasource_access(datasource)
+                for datasource in datasources
+            ))
+        if has_access:
+            return redirect('/superset/dashboard/{}'.format(dashboard_id))
+
         if request.args.get('action') == 'go':
             for datasource in datasources:
                 access_request = DAR(

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message