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:
parent
764e4574d1
commit
55f8e2a565
1 changed files with 8 additions and 4 deletions
|
@ -49,11 +49,15 @@ final class ReleephRequestActionController extends ReleephController {
|
||||||
|
|
||||||
case 'mark-manually-picked':
|
case 'mark-manually-picked':
|
||||||
case 'mark-manually-reverted':
|
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(
|
throw new Exception(
|
||||||
"Bug! Only authoritative users (pushers, or users in pusherless ".
|
"Bug! Only pushers or the requestor can manually change a ".
|
||||||
"Releeph projects) can manually change a request's in-branch ".
|
"request's in-branch status!");
|
||||||
"status!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action === 'mark-manually-picked') {
|
if ($action === 'mark-manually-picked') {
|
||||||
|
|
Loading…
Reference in a new issue