Skip to content

Commit

Permalink
Allow access to unpublished dashboards that don't have roles
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina committed Nov 22, 2021
1 parent 81e1630 commit 893595e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1186,6 +1186,7 @@ def raise_for_dashboard_access(dashboard: "Dashboard") -> None:
is_user_admin()
or is_owner(dashboard, g.user)
or (dashboard.published and has_rbac_access)
or (not dashboard.published and not dashboard.roles)
)

if not can_access:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration_tests/dashboards/api_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_get_dashboard_no_data_access(self):
self.login(username="gamma")
uri = f"api/v1/dashboard/{dashboard.id}"
rv = self.client.get(uri)
assert rv.status_code == 403
assert rv.status_code == 200
# rollback changes
db.session.delete(dashboard)
db.session.commit()
Expand Down

0 comments on commit 893595e

Please sign in to comment.