From 55f8e2a5656edc96c651bd1ef1a89b7b0c32a58c Mon Sep 17 00:00:00 2001 From: Edward Speyer Date: Tue, 28 May 2013 16:21:26 +0100 Subject: [PATCH] Let requestors claim their code is picked Summary: In Releeph, `ReleephRequestHeaderView` will render you a "mark-manually-picked" button if (a) you are authoritative (chuckr) or (b) you are the person who created this Releeph request. However `ReleephRequestActionController`, which handles these button presses, will only do something if you are (a). This patch honors your button pressing if you are (b) as well. Test Plan: Push buttons. There's another bug in the Javascript do-stuff-without-reloading-the-page code that handles these button pushes, but I'd like to fix that separately from handling this hi-pri bug. Reviewers: epriestley, wez Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D6036 --- .../request/ReleephRequestActionController.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/applications/releeph/controller/request/ReleephRequestActionController.php b/src/applications/releeph/controller/request/ReleephRequestActionController.php index 64e1945e06..bd675fc57d 100644 --- a/src/applications/releeph/controller/request/ReleephRequestActionController.php +++ b/src/applications/releeph/controller/request/ReleephRequestActionController.php @@ -49,11 +49,15 @@ final class ReleephRequestActionController extends ReleephController { case 'mark-manually-picked': case 'mark-manually-reverted': - if (!$releeph_project->isAuthoritative($user)) { + if ( + $releeph_request->getRequestUserPHID() === $user->getPHID() || + $releeph_project->isAuthoritative($user)) { + + // We're all good! + } else { throw new Exception( - "Bug! Only authoritative users (pushers, or users in pusherless ". - "Releeph projects) can manually change a request's in-branch ". - "status!"); + "Bug! Only pushers or the requestor can manually change a ". + "request's in-branch status!"); } if ($action === 'mark-manually-picked') {