You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by li...@apache.org on 2023/08/24 23:40:04 UTC
[superset] branch master updated: chore: remove CssTemplate and Annotation access from gamma role (#24826)
This is an automated email from the ASF dual-hosted git repository.
lilykuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new 6ac906f388 chore: remove CssTemplate and Annotation access from gamma role (#24826)
6ac906f388 is described below
commit 6ac906f38807e0d0fa044c92e4d0984497bf140f
Author: Lily Kuang <li...@preset.io>
AuthorDate: Thu Aug 24 16:39:56 2023 -0700
chore: remove CssTemplate and Annotation access from gamma role (#24826)
---
superset/security/manager.py | 22 +++++++++++-----------
tests/integration_tests/security_tests.py | 3 ---
2 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/superset/security/manager.py b/superset/security/manager.py
index 128d0dda8c..0bbcf53180 100644
--- a/superset/security/manager.py
+++ b/superset/security/manager.py
@@ -156,8 +156,6 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
}
GAMMA_READ_ONLY_MODEL_VIEWS = {
- "Annotation",
- "CssTemplate",
"Dataset",
"Datasource",
} | READ_ONLY_MODEL_VIEWS
@@ -180,19 +178,21 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
} | USER_MODEL_VIEWS
ALPHA_ONLY_VIEW_MENUS = {
- "Manage",
- "CSS Templates",
- "Annotation Layers",
- "Queries",
- "Import dashboards",
- "Upload a CSV",
- "ReportSchedule",
"Alerts & Report",
- "TableSchemaView",
- "CsvToDatabaseView",
+ "Annotation Layers",
+ "Annotation",
+ "CSS Templates",
"ColumnarToDatabaseView",
+ "CssTemplate",
+ "CsvToDatabaseView",
"ExcelToDatabaseView",
+ "Import dashboards",
"ImportExportRestApi",
+ "Manage",
+ "Queries",
+ "ReportSchedule",
+ "TableSchemaView",
+ "Upload a CSV",
}
ADMIN_ONLY_PERMISSIONS = {
diff --git a/tests/integration_tests/security_tests.py b/tests/integration_tests/security_tests.py
index f741ec4315..90be0edd17 100644
--- a/tests/integration_tests/security_tests.py
+++ b/tests/integration_tests/security_tests.py
@@ -1346,7 +1346,6 @@ class TestRolePermission(SupersetTestCase):
self.assert_cannot_menu("Alerts & Report", perm_set)
def assert_can_gamma(self, perm_set):
- self.assert_can_read("CssTemplate", perm_set)
self.assert_can_read("Dataset", perm_set)
# make sure that user can create slices and dashboards
@@ -1514,8 +1513,6 @@ class TestRolePermission(SupersetTestCase):
# make sure that user can create slices and dashboards
self.assert_can_all("Dashboard", gamma_perm_set)
self.assert_can_read("Dataset", gamma_perm_set)
- self.assert_can_read("Annotation", gamma_perm_set)
- self.assert_can_read("CssTemplate", gamma_perm_set)
# make sure that user can create slices and dashboards
self.assert_can_all("Chart", gamma_perm_set)