Skip to content

Commit

Permalink
chore: remove CssTemplate and Annotation access from gamma role (#24826)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6ac906f)
  • Loading branch information
Lily Kuang authored and michael-s-molina committed Aug 29, 2023
1 parent 2c99366 commit 55c57b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
22 changes: 11 additions & 11 deletions superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = {
Expand Down
3 changes: 0 additions & 3 deletions tests/integration_tests/security_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,6 @@ def assert_cannot_gamma(self, perm_set):
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
Expand Down Expand Up @@ -1514,8 +1513,6 @@ def test_gamma_permissions(self):
# 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)
Expand Down

0 comments on commit 55c57b9

Please sign in to comment.