From b2b652ef288ee2eee14d6f5192966513480bf034 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Mon, 30 Nov 2015 16:54:31 -0800 Subject: [PATCH] Allow builtin Phame UI to be publicly viewable Summary: These weren't open to the public even if the blog was public. Test Plan: View a blog post, blog view, and blog manage page while logged out. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Differential Revision: https://secure.phabricator.com/D14619 --- .../phame/controller/blog/PhameBlogManageController.php | 4 ++++ .../phame/controller/blog/PhameBlogViewController.php | 8 +++++--- .../phame/controller/post/PhamePostViewController.php | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/applications/phame/controller/blog/PhameBlogManageController.php b/src/applications/phame/controller/blog/PhameBlogManageController.php index 8685bb9e2c..bad4533638 100644 --- a/src/applications/phame/controller/blog/PhameBlogManageController.php +++ b/src/applications/phame/controller/blog/PhameBlogManageController.php @@ -2,6 +2,10 @@ final class PhameBlogManageController extends PhameBlogController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer(); $id = $request->getURIData('id'); diff --git a/src/applications/phame/controller/blog/PhameBlogViewController.php b/src/applications/phame/controller/blog/PhameBlogViewController.php index 631c86e27b..7ac5c08f73 100644 --- a/src/applications/phame/controller/blog/PhameBlogViewController.php +++ b/src/applications/phame/controller/blog/PhameBlogViewController.php @@ -4,6 +4,10 @@ final class PhameBlogViewController extends PhameBlogController { private $blog; + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer(); $id = $request->getURIData('id'); @@ -158,9 +162,7 @@ final class PhameBlogViewController extends PhameBlogController { id(new PhabricatorActionView()) ->setIcon('fa-pencil') ->setHref($this->getApplicationURI('blog/manage/'.$blog->getID().'/')) - ->setName(pht('Manage Blog')) - ->setDisabled(!$can_edit) - ->setWorkflow(!$can_edit)); + ->setName(pht('Manage Blog'))); return $actions; } diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php index fcf9dad8b8..bef629a9be 100644 --- a/src/applications/phame/controller/post/PhamePostViewController.php +++ b/src/applications/phame/controller/post/PhamePostViewController.php @@ -2,6 +2,10 @@ final class PhamePostViewController extends PhamePostController { + public function shouldAllowPublic() { + return true; + } + public function handleRequest(AphrontRequest $request) { $viewer = $request->getViewer();