Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove CssTemplate and Annotation access from gamma role #24826

Merged
merged 3 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions superset/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ class SupersetSecurityManager( # pylint: disable=too-many-public-methods
}

GAMMA_READ_ONLY_MODEL_VIEWS = {
"Annotation",
"CssTemplate",
"Dataset",
"Datasource",
} | READ_ONLY_MODEL_VIEWS
Expand All @@ -179,19 +177,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",
Copy link
Member

@eschutho eschutho Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yey for alphabetization! 🙏

}

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 @@ -1345,7 +1345,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 @@ -1513,8 +1512,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
Loading