aminghadersohi commented on code in PR #45067:
URL: https://github.com/apache/superset/pull/45067#discussion_r4224236218


##########
superset/mcp_service/chart/tool/get_chart_data.py:
##########
@@ -547,11 +551,15 @@ async def execute_chart_data(  # noqa: C901
         )
         logger.info("Getting data for chart %s: %s", chart_id, chart_name)
 
-        # Guests skip the RBAC check (authorize_query covers it) but keep the
+        # Table guests skip the RBAC check (authorize_query covers it) but 
keep the
         # existence check, so a deleted dataset still returns
         # DatasetNotAccessible.
-        validation_result = validate_chart_dataset(
-            chart_datasource_id, check_access=not guest_scope.is_guest_read()
+        validation_result: DatasetValidationResult = (
+            validate_chart_semantic_view(chart_datasource_id)
+            if chart_datasource_type == DatasourceType.SEMANTIC_VIEW.value
+            else validate_chart_dataset(
+                chart_datasource_id, check_access=not 
guest_scope.is_guest_read()
+            )
         )

Review Comment:
   Confirmed: an embedded guest without `datasource_access` fails 
`view.raise_for_access()` here yet passes the dashboard branch of 
`security_manager.raise_for_access(query_context=...)` downstream. Fail-closed 
and not a regression; mirroring the table branch's `check_access=not 
guest_scope.is_guest_read()` fixes it.



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