Skip to content

Commit

Permalink
fix: database alpha permissions (apache#12136)
Browse files Browse the repository at this point in the history
* fix: database alpha permissions

* add test

(cherry picked from commit 2f0add3)
  • Loading branch information
dpgaspar authored and Henry Yeh committed Dec 21, 2020
1 parent c6a08fd commit ce05a3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
SecurityManager
):
userstatschartview = None
READ_ONLY_MODEL_VIEWS = {"DatabaseAsync", "DatabaseView", "DruidClusterModelView"}
READ_ONLY_MODEL_VIEWS = {"Database", "DruidClusterModelView", "DynamicPlugin"}

USER_MODEL_VIEWS = {
"UserDBModelView",
Expand Down
2 changes: 2 additions & 0 deletions tests/security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ def assert_can_alpha(self, perm_set):
self.assert_can_all("CssTemplate", perm_set)
self.assert_can_all("Dataset", perm_set)
self.assert_can_read("Query", perm_set)
self.assert_can_read("Database", perm_set)
self.assertIn(("can_import_dashboards", "Superset"), perm_set)
self.assertIn(("can_this_form_post", "CsvToDatabaseView"), perm_set)
self.assertIn(("can_this_form_get", "CsvToDatabaseView"), perm_set)
Expand All @@ -701,6 +702,7 @@ def assert_cannot_alpha(self, perm_set):
self.assert_cannot_write("Queries", perm_set)
self.assert_cannot_write("RoleModelView", perm_set)
self.assert_cannot_write("UserDBModelView", perm_set)
self.assert_cannot_write("Database", perm_set)

def assert_can_admin(self, perm_set):
self.assert_can_all("Database", perm_set)
Expand Down

0 comments on commit ce05a3d

Please sign in to comment.