bito-code-review[bot] commented on PR #44215:
URL: https://github.com/apache/superset/pull/44215#issuecomment-5655197494

   <!-- Bito Reply -->
   The flagged issue is correct. Semantic-view charts often lack a direct 
`chart.datasource` reference, causing the current security check to fail and 
incorrectly strip `form_data` even when access is authorized via the dashboard.
   
   To resolve this, you should update the check to handle cases where the 
datasource is resolved through the dashboard context, even if 
`chart.datasource` is None. You can modify `_serialize_dashboard_chart` in 
`superset/dashboards/api.py` to check the chart's resolved datasource if 
available.
   
   Would you like me to implement this fix and check the rest of the PR 
comments for you?
   
   **superset/dashboards/api.py**
   ```
   if not (
               security_manager.can_access_chart(chart)
               or (
                   (chart.datasource is not None or hasattr(chart, 
'get_datasource'))
                   and security_manager.can_drill_dataset_via_dashboard_access(
                       chart.datasource or chart.get_datasource(), dashboard
                   )
               )
           ):
   ```


-- 
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]

Reply via email to