Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14755304
D17187.id41332.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D17187.id41332.diff
View Options
diff --git a/src/applications/diffusion/xaction/DiffusionCommitAuditTransaction.php b/src/applications/diffusion/xaction/DiffusionCommitAuditTransaction.php
--- a/src/applications/diffusion/xaction/DiffusionCommitAuditTransaction.php
+++ b/src/applications/diffusion/xaction/DiffusionCommitAuditTransaction.php
@@ -13,6 +13,23 @@
return ($this->getViewerAuditStatus($commit, $viewer) !== null);
}
+ protected function isViewerAnyActiveAuditor(
+ PhabricatorRepositoryCommit $commit,
+ PhabricatorUser $viewer) {
+
+ // This omits various inactive states like "Resigned" and "Not Required".
+
+ return $this->isViewerAuditStatusAmong(
+ $commit,
+ $viewer,
+ array(
+ PhabricatorAuditStatusConstants::AUDIT_REQUIRED,
+ PhabricatorAuditStatusConstants::CONCERNED,
+ PhabricatorAuditStatusConstants::ACCEPTED,
+ PhabricatorAuditStatusConstants::AUDIT_REQUESTED,
+ ));
+ }
+
protected function isViewerAcceptingAuditor(
PhabricatorRepositoryCommit $commit,
PhabricatorUser $viewer) {
diff --git a/src/applications/diffusion/xaction/DiffusionCommitResignTransaction.php b/src/applications/diffusion/xaction/DiffusionCommitResignTransaction.php
--- a/src/applications/diffusion/xaction/DiffusionCommitResignTransaction.php
+++ b/src/applications/diffusion/xaction/DiffusionCommitResignTransaction.php
@@ -28,7 +28,7 @@
public function generateOldValue($object) {
$actor = $this->getActor();
- return !$this->isViewerAnyAuditor($object, $actor);
+ return !$this->isViewerAnyActiveAuditor($object, $actor);
}
public function applyExternalEffects($object, $value) {
@@ -38,11 +38,11 @@
}
protected function validateAction($object, PhabricatorUser $viewer) {
- if (!$this->isViewerAnyAuditor($object, $viewer)) {
+ if (!$this->isViewerAnyActiveAuditor($object, $viewer)) {
throw new Exception(
pht(
'You can not resign from this commit because you are not an '.
- 'auditor.'));
+ 'active auditor.'));
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 3:59 PM (24 m, 18 s)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7033065
Default Alt Text
D17187.id41332.diff (2 KB)
Attached To
Mode
D17187: Prevent users from resigning from audits they've already resigned from
Attached
Detach File
Event Timeline
Log In to Comment