From 960a1ab1ecd6d28f0bcb99c579e852fe0ea309fc Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Tue, 30 Apr 2024 18:01:25 +0200 Subject: [PATCH] Facts: Fix displaying charts for anonymous users Summary: Charts in the Facts prototype application (e.g. as a Burndown chart on a project's Reports page) remained empty for users not logged in: payload response was a login dialog instead of actual data to render. Thus set `shouldAllowPublic()` (as for many other Controllers). Closes T15436 Test Plan: * As an admin, enable the Facts prototype application. * As an admin, set "Can Use Application" to "Public" for Projects on http://phorge.localhost/applications/view/PhabricatorProjectApplication/ * As an admin, set "Can Use Application" to "Public" for Facts on http://phorge.localhost/applications/view/PhabricatorFactApplication/ * Go to a project with tasks; select "Reports (Prototype)" in the sidebar * Both as a logged in and as an anonymous user, check if the charts render. * Click the `View Chart` option and both as a logged in and as an anonymous user, check if the charts render at an URI like http://phorge.localhost/fact/chart/a1b2c3d4e5f6/ * As an admin, restrict "Can Use Application" to "Users" for Facts on `/applications/view/PhabricatorFactApplication/` * As an anonymous user, check that http://phorge.localhost/fact/chart/a1b2c3d4e5f6/ requires a login now. * As an anonymous user, check that charts on http://phorge.localhost/project/reports/1/ remain empty boxes (which is not ideal but not a big difference to beforehand). Reviewers: O1 Blessed Committers, avivey Reviewed By: O1 Blessed Committers, avivey Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno Maniphest Tasks: T15436 Differential Revision: https://we.phorge.it/D25608 --- .../fact/controller/PhabricatorFactChartController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/applications/fact/controller/PhabricatorFactChartController.php b/src/applications/fact/controller/PhabricatorFactChartController.php index 4004f6f27c..c22ec2d129 100644 --- a/src/applications/fact/controller/PhabricatorFactChartController.php +++ b/src/applications/fact/controller/PhabricatorFactChartController.php @@ -3,6 +3,10 @@ final class PhabricatorFactChartController extends PhabricatorFactController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer();