Parvezkhan0 commented on code in PR #36548:
URL: https://github.com/apache/superset/pull/36548#discussion_r2613804945
##########
superset/security/manager.py:
##########
@@ -389,6 +389,61 @@ class SupersetSecurityManager( # pylint:
disable=too-many-public-methods
("can_read", "Database"),
}
+ # Permissions for the Public role - minimal read-only access for viewing
+ # dashboards without authentication. This is more restrictive than Gamma.
+ # Users can set PUBLIC_ROLE_LIKE = "Public" to use these sensible defaults.
+ PUBLIC_ROLE_PERMISSIONS = {
+ # Core dashboard viewing
+ ("can_read", "Dashboard"),
+ ("can_read", "Chart"),
+ ("can_dashboard", "Superset"),
+ ("can_slice", "Superset"),
+ ("can_explore_json", "Superset"),
+ ("can_dashboard_permalink", "Superset"),
+ ("can_read", "DashboardPermalinkRestApi"),
+ # Dashboard filter interactions
+ ("can_read", "DashboardFilterStateRestApi"),
+ ("can_write", "DashboardFilterStateRestApi"),
+ # API access for chart rendering
+ ("can_time_range", "Api"),
+ ("can_query_form_data", "Api"),
+ ("can_query", "Api"),
+ # CSS for dashboard styling
+ ("can_read", "CssTemplate"),
+ # Embedded dashboard support
+ ("can_read", "EmbeddedDashboard"),
+ # Datasource metadata for chart rendering
+ ("can_get", "Datasource"),
+ ("can_external_metadata", "Datasource"),
+ ("can_external_metadata_by_name", "Datasource"),
+ # Security API for CSRF tokens
+ ("can_read", "SecurityRestApi"),
+ # Menu and OpenAPI access
+ ("can_get", "OpenApi"),
+ ("can_get", "MenuApi"),
+ }
+
Review Comment:
Public is given several permissions that Gamma does not have:
can_read → CssTemplate
can_read → SecurityRestApi
can_get → MenuApi
can_get → OpenApi
can_external_metadata_by_name → Datasource
Because of these, public_perm_set - gamma_perm_set is not empty, so
test_public_role_more_restrictive_than_gamma will fail. Either remove these
permissions from Public or update the test, but both cannot be true at once.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]