1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 06:42:42 +01:00

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
This commit is contained in:
Andre Klapper 2024-04-30 18:01:25 +02:00
parent c8fb504690
commit 960a1ab1ec

View file

@ -3,6 +3,10 @@
final class PhabricatorFactChartController
extends PhabricatorFactController {
public function shouldAllowPublic() {
return true;
}
public function handleRequest(AphrontRequest $request) {
$viewer = $request->getViewer();