mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-22 14:52:41 +01:00
Allow "!accept" to be enabled through configuration
Summary: For reasons explained in the config I've omitted this from the default action set, but it's trivial to support it. See D916. Test Plan: Commented on a revision, was informed I could "!accept" in the email. Used "!accept" to accept the revision. Reviewers: Makinde, jungejason, nh, tuomaspelkonen, aran Reviewed By: Makinde CC: aran, Makinde Differential Revision: 928
This commit is contained in:
parent
9215d330ad
commit
a42f116749
2 changed files with 14 additions and 1 deletions
|
@ -522,6 +522,13 @@ return array(
|
|||
|
||||
'differential.field-selector' => 'DifferentialDefaultFieldSelector',
|
||||
|
||||
// If you set this to true, users can "!accept" revisions via email (normally,
|
||||
// they can take other actions but can not "!accept"). This action is disabled
|
||||
// by default because email authentication can be configured to be very weak,
|
||||
// and, socially, email "!accept" is kind of sketchy and implies revisions may
|
||||
// not actually be receiving thorough review.
|
||||
'differential.enable-email-accept' => false,
|
||||
|
||||
|
||||
// -- Maniphest ------------------------------------------------------------- //
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
|
|||
}
|
||||
|
||||
public function getSupportedCommands() {
|
||||
return array(
|
||||
$actions = array(
|
||||
DifferentialAction::ACTION_COMMENT,
|
||||
DifferentialAction::ACTION_REJECT,
|
||||
DifferentialAction::ACTION_ABANDON,
|
||||
|
@ -97,6 +97,12 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
|
|||
DifferentialAction::ACTION_RETHINK,
|
||||
'unsubscribe',
|
||||
);
|
||||
|
||||
if (PhabricatorEnv::getEnvConfig('differential.enable-email-accept')) {
|
||||
$actions[] = DifferentialAction::ACTION_ACCEPT;
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
public function receiveEmail(PhabricatorMetaMTAReceivedMail $mail) {
|
||||
|
|
Loading…
Reference in a new issue