mirror of
https://github.com/apache/superset.git
synced 2026-04-23 18:14:56 +00:00
feat(css templates): security perm simplification (#11856)
* feat: security converge css templates * fix security tests * fix JS test * add migration * black and fix migration
This commit is contained in:
committed by
GitHub
parent
61064b9634
commit
71c567bf3a
@@ -159,6 +159,20 @@ class TestCssTemplateApi(SupersetTestCase):
|
||||
rv = self.get_assert_metric(uri, "info")
|
||||
assert rv.status_code == 200
|
||||
|
||||
def test_info_security_css_template(self):
|
||||
"""
|
||||
CssTemplate API: Test info security
|
||||
"""
|
||||
self.login(username="admin")
|
||||
params = {"keys": ["permissions"]}
|
||||
uri = f"api/v1/css_template/_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
|
||||
|
||||
@pytest.mark.usefixtures("create_css_templates")
|
||||
def test_get_css_template(self):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user