Opt-in approve your own Differential revisions
Summary: Did exactly what @epriestley suggested in T1428#2. Test Plan: Turn it on in your config, post a revision, accept it. Turn it off in your config, post a revision, can't accept it. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D2900
This commit is contained in:
		
				
					committed by
					
						
						epriestley
					
				
			
			
				
	
			
			
			
						parent
						
							948259ee92
						
					
				
				
					commit
					c821639e93
				
			@@ -536,13 +536,18 @@ final class DifferentialRevisionViewController extends DifferentialController {
 | 
			
		||||
    $viewer_did_accept = ($viewer_phid === $revision->loadReviewedBy());
 | 
			
		||||
    $status = $revision->getStatus();
 | 
			
		||||
 | 
			
		||||
    $allow_self_accept = PhabricatorEnv::getEnvConfig(
 | 
			
		||||
        'differential.allow-self-accept', false);
 | 
			
		||||
 | 
			
		||||
    if ($viewer_is_owner) {
 | 
			
		||||
      switch ($status) {
 | 
			
		||||
        case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
 | 
			
		||||
          $actions[DifferentialAction::ACTION_ACCEPT] = $allow_self_accept;
 | 
			
		||||
          $actions[DifferentialAction::ACTION_ABANDON] = true;
 | 
			
		||||
          $actions[DifferentialAction::ACTION_RETHINK] = true;
 | 
			
		||||
          break;
 | 
			
		||||
        case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
 | 
			
		||||
          $actions[DifferentialAction::ACTION_ACCEPT] = $allow_self_accept;
 | 
			
		||||
          $actions[DifferentialAction::ACTION_ABANDON] = true;
 | 
			
		||||
          $actions[DifferentialAction::ACTION_REQUEST] = true;
 | 
			
		||||
          break;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user