mirror of
https://github.com/apache/superset.git
synced 2026-04-19 16:14:52 +00:00
feat(dashboards): security permissions simplification (#12012)
* feat(dashboards): security perm simplification * fix tests * fix tests * remove unnecessary mapping * fix JS tests * fix cypress test and explore endpoint * update alembic down revision * Merge branch 'master' into feat/security-converge-dashboards # Conflicts: # superset/constants.py # tests/security_tests.py
This commit is contained in:
committed by
GitHub
parent
700dee6db6
commit
dd5cdb1b5f
@@ -198,6 +198,20 @@ class TestDashboardApi(SupersetTestCase, ApiOwnersTestCaseMixin):
|
||||
rv = self.get_assert_metric(uri, "info")
|
||||
self.assertEqual(rv.status_code, 200)
|
||||
|
||||
def test_info_security_database(self):
|
||||
"""
|
||||
Dashboard API: Test info security
|
||||
"""
|
||||
self.login(username="admin")
|
||||
params = {"keys": ["permissions"]}
|
||||
uri = f"api/v1/dashboard/_info?q={prison.dumps(params)}"
|
||||
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
|
||||
|
||||
def test_get_dashboard_not_found(self):
|
||||
"""
|
||||
Dashboard API: Test get dashboard not found
|
||||
|
||||
Reference in New Issue
Block a user