You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "john-bodley (via GitHub)" <gi...@apache.org> on 2023/08/16 20:22:52 UTC

[GitHub] [superset] john-bodley commented on a diff in pull request #25008: fix: Address regression introduced in #24789

john-bodley commented on code in PR #25008:
URL: https://github.com/apache/superset/pull/25008#discussion_r1296387970


##########
superset/security/manager.py:
##########
@@ -1858,9 +1858,13 @@ def raise_for_access(
                 or self.can_access("datasource_access", datasource.perm or "")
                 or self.is_owner(datasource)
                 or (
+                    # Check whether the datasource is associated with a dashboard in a
+                    # trustworthy manner, i.e., we need to validate that the specified
+                    # dashboard is actually associated with said datasource.
                     form_data
                     and (dashboard_id := form_data.get("dashboardId"))
                     and (dashboard := DashboardDAO.find_by_id(dashboard_id))
+                    and any(slc.datasource == datasource for slc in dashboard.slices)
                     and self.can_access_dashboard(dashboard)

Review Comment:
   @jfrag1 I updated the PR description.



-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org