diff --git a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php index 280fb5c8a8..47783a9d43 100644 --- a/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php +++ b/src/applications/differential/field/specification/DifferentialReviewersFieldSpecification.php @@ -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!");