codeant-ai-for-open-source[bot] commented on code in PR #45698:
URL: https://github.com/apache/superset/pull/45698#discussion_r4405123620


##########
superset/commands/report/execute.py:
##########
@@ -791,17 +802,55 @@ def _get_url(
         ):
             return self._get_tab_url(dashboard_state, 
user_friendly=user_friendly)
 
+        return self._get_plain_dashboard_url(user_friendly=user_friendly, 
**kwargs)
+
+    def _get_plain_dashboard_url(
+        self, user_friendly: bool = False, **kwargs: Any
+    ) -> str:
+        """Return the dashboard URL without any stored permalink state."""
+        dashboard = self._report_schedule.dashboard
         dashboard_id_or_slug = (
             dashboard.uuid if dashboard.uuid is not None else dashboard.id
         )
         return get_url_path(
             "Superset.dashboard",
             user_friendly=user_friendly,
             dashboard_id_or_slug=dashboard_id_or_slug,
-            force=force,
+            force=self._get_force_param(),
             **kwargs,
         )
 
+    def _get_failure_notification_url(self) -> str:
+        """
+        Return the link for a failure notification.
+
+        The stateful link is a permalink created as the executor. When the
+        executor cannot access the dashboard, that is the very failure being
+        reported, so link to the dashboard itself rather than letting the
+        notification fail too.
+        """
+        try:
+            return self._get_url(user_friendly=True)
+        except ReportScheduleExecutorAccessDeniedError:
+            return self._get_plain_dashboard_url(user_friendly=True)
+
+    def _raise_for_executor_dashboard_access(self) -> None:
+        """
+        Fail with an actionable error when the executor cannot see the 
dashboard.
+
+        Without this, a plain dashboard URL renders the not-found page for the
+        executor and surfaces only as a generic screenshot failure.
+        """
+        user = get_user()
+        if user is None or getattr(user, "is_anonymous", False):
+            return
+        try:
+            
security_manager.raise_for_access(dashboard=self._report_schedule.dashboard)

Review Comment:
   ✅ **CodeAnt verified this suggestion was addressed in subsequent commits and 
marked this thread resolved** as of `982dc32`.
   
   After the normal dashboard access check, the code now checks 
`is_excluded_by_extra_access("dashboards", dashboard.id)` and raises 
`ReportScheduleExecutorAccessDeniedError` for excluded dashboards.
   
   <sub>If that's not right, unresolve this thread and CodeAnt will leave it 
open.</sub>
   
   <!-- codeant-auto-resolve-reply -->



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