diff --git a/tests/security_tests.py b/tests/security_tests.py index 4c20aeee67bbd..1b7e0b3a5e55b 100644 --- a/tests/security_tests.py +++ b/tests/security_tests.py @@ -538,6 +538,17 @@ def test_schemas_accessible_by_user_datasource_and_schema_access(self, mock_g): self.assertIsNotNone(vm) delete_schema_perm("[examples].[2]") + @pytest.mark.usefixtures("load_world_bank_dashboard_with_slices") + def test_gamma_user_schema_access_to_dashboards(self): + dash = db.session.query(Dashboard).filter_by(slug="world_health").first() + dash.published = True + db.session.commit() + + self.login(username="gamma") + data = str(self.client.get("api/v1/dashboard/").data) + self.assertIn("/superset/dashboard/world_health/", data) + self.assertNotIn("/superset/dashboard/births/", data) + def test_gamma_user_schema_access_to_tables(self): self.login(username="gamma") data = str(self.client.get("tablemodelview/list/").data)