1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

Allow to push revisions to review by himself to Differential (bug T1879, change 1/2, Differential part)

Summary: Checks if the revision author is in reviewers only if differential.allow-self-accept is false.

Test Plan:
Tested locally pushing revisions with "arc diff" to a Phabricator
server with differential.allow-self-accept at true or false with
myself or not as reviewer.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1879

Differential Revision: https://secure.phabricator.com/D3673
This commit is contained in:
Dereckson 2012-10-12 07:40:08 -07:00 committed by epriestley
parent 8798d2189e
commit b7b783d771

View file

@ -61,7 +61,10 @@ final class DifferentialReviewersFieldSpecification
}
public function validateField() {
if (in_array($this->getUser()->getPHID(), $this->reviewers)) {
$allow_self_accept = PhabricatorEnv::getEnvConfig(
'differential.allow-self-accept', false);
if (!$allow_self_accept
&& in_array($this->getUser()->getPHID(), $this->reviewers)) {
$this->error = 'Invalid';
throw new DifferentialFieldValidationException(
"You may not review your own revision!");