1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

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
This commit is contained in:
Edward Speyer 2013-05-28 16:21:26 +01:00
parent 764e4574d1
commit 55f8e2a565

View file

@ -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') {