Skip to content

Commit

Permalink
check for access before requesting access (#4469)
Browse files Browse the repository at this point in the history
  • Loading branch information
timifasubaa authored and mistercrunch committed Feb 28, 2018
1 parent c2b42c4 commit 8626793
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,15 @@ def request_access(self):
.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(
Expand Down

0 comments on commit 8626793

Please sign in to comment.