fix: RBAC for export for dashboard viewers (#17527)

* set out export

* update test

* use default dataset

* update test

* these test work

* fix test

* update

* fix

* fix test

* make the test better
This commit is contained in:
Hugh A. Miles II
2021-11-25 20:10:41 -08:00
committed by GitHub
parent 7429282972
commit 2e29f36e78
14 changed files with 36 additions and 34 deletions

View File

@@ -744,9 +744,7 @@ class TestDatabaseApi(SupersetTestCase):
rv = self.get_assert_metric(uri, "info")
data = json.loads(rv.data.decode("utf-8"))
assert rv.status_code == 200
assert "can_read" in data["permissions"]
assert "can_write" in data["permissions"]
assert len(data["permissions"]) == 2
assert set(data["permissions"]) == {"can_read", "can_write", "can_export"}
def test_get_invalid_database_table_metadata(self):
"""
@@ -1143,9 +1141,7 @@ class TestDatabaseApi(SupersetTestCase):
argument = [database.id]
uri = f"api/v1/database/export/?q={prison.dumps(argument)}"
rv = self.client.get(uri)
# export only requires can_read now, but gamma need to have explicit access to
# view the database
assert rv.status_code == 404
assert rv.status_code == 401
def test_export_database_non_existing(self):
"""