@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Author Can Close Audit Option

Summary: Fixes T2339

Test Plan: Close Audit button does not appear if audit.can-author-close-audit option is disabled

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2339

Differential Revision: https://secure.phabricator.com/D4525

authored by

Debarghya Das and committed by
epriestley
b801ca8e ed2c050b

+22 -2
+5
conf/default.conf.php
··· 1338 1338 // the $PATH environment variable, for when these binaries are in non-standard 1339 1339 // locations. 1340 1340 'environment.append-paths' => array(), 1341 + 1342 + // -- Audit ---------------------------------------------------------- // 1343 + 1344 + // Controls whether or not task creator can Close Audits 1345 + 'audit.can-author-close-audit' => false, 1341 1346 );
+4
src/applications/audit/editor/PhabricatorAuditCommentEditor.php
··· 109 109 $actor_is_author = ($actor->getPHID() == $commit->getAuthorPHID()); 110 110 111 111 if ($action == PhabricatorAuditActionConstants::CLOSE) { 112 + if (!PhabricatorEnv::getEnvConfig('audit.can-author-close-audit')) { 113 + throw new Exception('Cannot Close Audit without enabling'. 114 + 'audit.can-author-close-audit'); 115 + } 112 116 // "Close" means wipe out all the concerns. 113 117 $concerned_status = PhabricatorAuditStatusConstants::CONCERNED; 114 118 foreach ($requests as $request) {
+10
src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
··· 55 55 ->setDescription(pht('Hard byte limit on including patches in email.')), 56 56 $this->newOption('metamta.diffusion.time-limit', 'int', 60) 57 57 ->setDescription(pht('Hard time limit on generating patches.')), 58 + $this->newOption( 59 + 'audit.can-author-close-audit', 60 + 'bool', 61 + false) 62 + ->setBoolOptions( 63 + array( 64 + pht("Enable Closing Audits"), 65 + pht("Disable Closing Audits"), 66 + )) 67 + ->setDescription(pht('Controls whether Author can Close Audits.')), 58 68 ); 59 69 } 60 70
+3 -2
src/applications/diffusion/controller/DiffusionCommitController.php
··· 748 748 749 749 $status_concern = PhabricatorAuditCommitStatusConstants::CONCERN_RAISED; 750 750 $concern_raised = ($commit->getAuditStatus() == $status_concern); 751 - 752 - if ($user_is_author && $concern_raised) { 751 + $can_close_option = PhabricatorEnv::getEnvConfig( 752 + 'audit.can-author-close-audit'); 753 + if ($can_close_option && $user_is_author && $concern_raised) { 753 754 $actions[PhabricatorAuditActionConstants::CLOSE] = true; 754 755 } 755 756