Fixed viewing dashboards as anonymous (#1320)

This commit is contained in:
Juho Lamminmäki
2016-10-11 18:04:00 +03:00
committed by Maxime Beauchemin
parent fe66557bbb
commit 1e6e144d24
2 changed files with 21 additions and 2 deletions

View File

@@ -396,6 +396,18 @@ class CoreTests(CaravelTestCase):
resp = self.get_resp('/dashboardmodelview/list/')
assert "/caravel/dashboard/world_health/" not in resp
def test_dashboard_with_created_by_can_be_accessed_by_public_users(self):
self.logout()
self.setup_public_access_for_dashboard('birth_names')
dash = db.session.query(models.Dashboard).filter_by(dashboard_title="Births").first()
dash.owners = [appbuilder.sm.find_user('admin')]
dash.created_by = appbuilder.sm.find_user('admin')
db.session.merge(dash)
db.session.commit()
assert 'Births' in self.get_resp('/caravel/dashboard/births/')
def test_only_owners_can_save(self):
dash = (
db.session