From 376ea1ddf5a32e2ac3b8acc238d6d02c607ab8cf Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 1 Jun 2018 13:52:41 -0700 Subject: [PATCH] Support logged-out access to more Harbormaster controllers Summary: Fixes T13145. The list controllers properly support public access already, but some of the view/detail controllers did not. Allow logged-out users to browse builds, buildables, plans, etc., provided they can see the corresponding objects. Test Plan: As a logged-out user, browsed around builds, build plans, logs, etc., without hitting any login pages. Reviewers: amckinley Reviewed By: amckinley Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13145 Differential Revision: https://secure.phabricator.com/D19459 --- .../controller/HarbormasterBuildLogDownloadController.php | 4 ++++ .../controller/HarbormasterBuildLogRenderController.php | 4 ++++ .../controller/HarbormasterBuildLogViewController.php | 4 ++++ .../controller/HarbormasterBuildViewController.php | 4 ++++ .../controller/HarbormasterBuildableViewController.php | 6 ++++-- .../controller/HarbormasterLintMessagesController.php | 4 ++++ .../controller/HarbormasterPlanViewController.php | 4 ++++ .../controller/HarbormasterStepViewController.php | 4 ++++ .../controller/HarbormasterUnitMessageListController.php | 4 ++++ .../controller/HarbormasterUnitMessageViewController.php | 4 ++++ 10 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/applications/harbormaster/controller/HarbormasterBuildLogDownloadController.php b/src/applications/harbormaster/controller/HarbormasterBuildLogDownloadController.php index 40313cdafd..ee02b25636 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildLogDownloadController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildLogDownloadController.php @@ -3,6 +3,10 @@ final class HarbormasterBuildLogDownloadController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $request = $this->getRequest(); $viewer = $request->getUser(); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php b/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php index 7a5050becf..0f1f2bc028 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildLogRenderController.php @@ -3,6 +3,10 @@ final class HarbormasterBuildLogRenderController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php index 888b3bddb2..0128dad0b6 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildLogViewController.php @@ -3,6 +3,10 @@ final class HarbormasterBuildLogViewController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php index ac3a7101fd..b0f2654ea6 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php @@ -3,6 +3,10 @@ final class HarbormasterBuildViewController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $request = $this->getRequest(); $viewer = $request->getUser(); diff --git a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php index 58e5cf8c49..2ebc934605 100644 --- a/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterBuildableViewController.php @@ -3,6 +3,10 @@ final class HarbormasterBuildableViewController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); @@ -350,6 +354,4 @@ final class HarbormasterBuildableViewController return array($lint, $unit); } - - } diff --git a/src/applications/harbormaster/controller/HarbormasterLintMessagesController.php b/src/applications/harbormaster/controller/HarbormasterLintMessagesController.php index e7636dbbd8..8fe1edbcaf 100644 --- a/src/applications/harbormaster/controller/HarbormasterLintMessagesController.php +++ b/src/applications/harbormaster/controller/HarbormasterLintMessagesController.php @@ -3,6 +3,10 @@ final class HarbormasterLintMessagesController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); diff --git a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php index 28bd16456d..6ebadf7a62 100644 --- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php @@ -2,6 +2,10 @@ final class HarbormasterPlanViewController extends HarbormasterPlanController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $id = $request->getURIData('id'); diff --git a/src/applications/harbormaster/controller/HarbormasterStepViewController.php b/src/applications/harbormaster/controller/HarbormasterStepViewController.php index a404b48e88..d4f1592264 100644 --- a/src/applications/harbormaster/controller/HarbormasterStepViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterStepViewController.php @@ -3,6 +3,10 @@ final class HarbormasterStepViewController extends HarbormasterPlanController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $id = $request->getURIData('id'); diff --git a/src/applications/harbormaster/controller/HarbormasterUnitMessageListController.php b/src/applications/harbormaster/controller/HarbormasterUnitMessageListController.php index 05f06a4e99..5f65bca86d 100644 --- a/src/applications/harbormaster/controller/HarbormasterUnitMessageListController.php +++ b/src/applications/harbormaster/controller/HarbormasterUnitMessageListController.php @@ -3,6 +3,10 @@ final class HarbormasterUnitMessageListController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); diff --git a/src/applications/harbormaster/controller/HarbormasterUnitMessageViewController.php b/src/applications/harbormaster/controller/HarbormasterUnitMessageViewController.php index 631c332938..9881da06c6 100644 --- a/src/applications/harbormaster/controller/HarbormasterUnitMessageViewController.php +++ b/src/applications/harbormaster/controller/HarbormasterUnitMessageViewController.php @@ -3,6 +3,10 @@ final class HarbormasterUnitMessageViewController extends HarbormasterController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer();