mistercrunch commented on code in PR #35237:
URL: https://github.com/apache/superset/pull/35237#discussion_r2374766771


##########
superset/views/core.py:
##########
@@ -796,19 +767,9 @@ def dashboard(
 
         try:
             dashboard.raise_for_access()
-        except SupersetSecurityException as ex:
-            # anonymous users should get the login screen, others should go to 
dashboard list  # noqa: E501
-            if g.user is None or g.user.is_anonymous:
-                redirect_url = 
f"{appbuilder.get_url_for_login}?next={request.url}"
-                warn_msg = "Users must be logged in to view this dashboard."
-            else:
-                redirect_url = url_for("DashboardModelView.list")
-                warn_msg = utils.error_msg_from_exception(ex)
-            return redirect_with_flash(
-                url=redirect_url,
-                message=warn_msg,
-                category="danger",
-            )
+        except SupersetSecurityException:
+            # Return 404 to avoid revealing dashboard existence
+            abort(404)

Review Comment:
   404 is most accurate when you don't have access



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