mirror of
https://github.com/apache/superset.git
synced 2026-04-12 20:57:55 +00:00
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:
@@ -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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user