mirror of
https://github.com/apache/superset.git
synced 2026-05-07 08:54:23 +00:00
fix: dataset name change and permission change (#21161)
* fix: dataset name change and permission change
This commit is contained in:
committed by
GitHub
parent
0c87ff783a
commit
3f2e894af3
@@ -267,6 +267,15 @@ class TestDatasetApi(SupersetTestCase):
|
||||
if backend() == "sqlite":
|
||||
return
|
||||
|
||||
# Add main database access to gamma role
|
||||
main_db = get_main_database()
|
||||
main_db_pvm = security_manager.find_permission_view_menu(
|
||||
"database_access", main_db.perm
|
||||
)
|
||||
gamma_role = security_manager.find_role("Gamma")
|
||||
gamma_role.permissions.append(main_db_pvm)
|
||||
db.session.commit()
|
||||
|
||||
self.login(username="gamma")
|
||||
uri = "api/v1/dataset/related/database"
|
||||
rv = self.client.get(uri)
|
||||
@@ -277,6 +286,10 @@ class TestDatasetApi(SupersetTestCase):
|
||||
main_db = get_main_database()
|
||||
assert filter(lambda x: x.text == main_db, response["result"]) != []
|
||||
|
||||
# revert gamma permission
|
||||
gamma_role.permissions.remove(main_db_pvm)
|
||||
db.session.commit()
|
||||
|
||||
@pytest.mark.usefixtures("load_energy_table_with_slice")
|
||||
def test_get_dataset_item(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user