Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15386873
D20257.id48364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D20257.id48364.diff
View Options
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1784,6 +1784,7 @@
'ManiphestTaskTitleTransaction' => 'applications/maniphest/xaction/ManiphestTaskTitleTransaction.php',
'ManiphestTaskTransactionType' => 'applications/maniphest/xaction/ManiphestTaskTransactionType.php',
'ManiphestTaskUnblockTransaction' => 'applications/maniphest/xaction/ManiphestTaskUnblockTransaction.php',
+ 'ManiphestTaskUnlockEngine' => 'applications/maniphest/engine/ManiphestTaskUnlockEngine.php',
'ManiphestTransaction' => 'applications/maniphest/storage/ManiphestTransaction.php',
'ManiphestTransactionComment' => 'applications/maniphest/storage/ManiphestTransactionComment.php',
'ManiphestTransactionEditor' => 'applications/maniphest/editor/ManiphestTransactionEditor.php',
@@ -4703,6 +4704,7 @@
'PhabricatorUnitsTestCase' => 'view/__tests__/PhabricatorUnitsTestCase.php',
'PhabricatorUnknownContentSource' => 'infrastructure/contentsource/PhabricatorUnknownContentSource.php',
'PhabricatorUnlockEngine' => 'applications/system/engine/PhabricatorUnlockEngine.php',
+ 'PhabricatorUnlockableInterface' => 'applications/system/interface/PhabricatorUnlockableInterface.php',
'PhabricatorUnsubscribedFromObjectEdgeType' => 'applications/transactions/edges/PhabricatorUnsubscribedFromObjectEdgeType.php',
'PhabricatorUser' => 'applications/people/storage/PhabricatorUser.php',
'PhabricatorUserApproveTransaction' => 'applications/people/xaction/PhabricatorUserApproveTransaction.php',
@@ -7419,6 +7421,7 @@
'PhabricatorEditEngineLockableInterface',
'PhabricatorEditEngineMFAInterface',
'PhabricatorPolicyCodexInterface',
+ 'PhabricatorUnlockableInterface',
),
'ManiphestTaskAssignHeraldAction' => 'HeraldAction',
'ManiphestTaskAssignOtherHeraldAction' => 'ManiphestTaskAssignHeraldAction',
@@ -7496,6 +7499,7 @@
'ManiphestTaskTitleTransaction' => 'ManiphestTaskTransactionType',
'ManiphestTaskTransactionType' => 'PhabricatorModularTransactionType',
'ManiphestTaskUnblockTransaction' => 'ManiphestTaskTransactionType',
+ 'ManiphestTaskUnlockEngine' => 'PhabricatorUnlockEngine',
'ManiphestTransaction' => 'PhabricatorModularTransaction',
'ManiphestTransactionComment' => 'PhabricatorApplicationTransactionComment',
'ManiphestTransactionEditor' => 'PhabricatorApplicationTransactionEditor',
diff --git a/src/applications/maniphest/engine/ManiphestTaskUnlockEngine.php b/src/applications/maniphest/engine/ManiphestTaskUnlockEngine.php
new file mode 100644
--- /dev/null
+++ b/src/applications/maniphest/engine/ManiphestTaskUnlockEngine.php
@@ -0,0 +1,14 @@
+<?php
+
+final class ManiphestTaskUnlockEngine
+ extends PhabricatorUnlockEngine {
+
+ public function newUnlockOwnerTransactions($object, $user) {
+ return array(
+ $this->newTransaction($object)
+ ->setTransactionType(ManiphestTaskOwnerTransaction::TRANSACTIONTYPE)
+ ->setNewValue($user->getPHID()),
+ );
+ }
+
+}
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -21,7 +21,8 @@
PhabricatorEditEngineSubtypeInterface,
PhabricatorEditEngineLockableInterface,
PhabricatorEditEngineMFAInterface,
- PhabricatorPolicyCodexInterface {
+ PhabricatorPolicyCodexInterface,
+ PhabricatorUnlockableInterface {
const MARKUP_FIELD_DESCRIPTION = 'markup:desc';
@@ -649,4 +650,12 @@
return new ManiphestTaskPolicyCodex();
}
+
+/* -( PhabricatorUnlockableInterface )------------------------------------- */
+
+
+ public function newUnlockEngine() {
+ return new ManiphestTaskUnlockEngine();
+ }
+
}
diff --git a/src/applications/system/engine/PhabricatorUnlockEngine.php b/src/applications/system/engine/PhabricatorUnlockEngine.php
--- a/src/applications/system/engine/PhabricatorUnlockEngine.php
+++ b/src/applications/system/engine/PhabricatorUnlockEngine.php
@@ -13,7 +13,13 @@
'PhabricatorApplicationTransactionInterface'));
}
- return new PhabricatorDefaultUnlockEngine();
+ if ($object instanceof PhabricatorUnlockableInterface) {
+ $engine = $object->newUnlockEngine();
+ } else {
+ $engine = new PhabricatorDefaultUnlockEngine();
+ }
+
+ return $engine;
}
public function newUnlockViewTransactions($object, $user) {
diff --git a/src/applications/system/interface/PhabricatorUnlockableInterface.php b/src/applications/system/interface/PhabricatorUnlockableInterface.php
new file mode 100644
--- /dev/null
+++ b/src/applications/system/interface/PhabricatorUnlockableInterface.php
@@ -0,0 +1,18 @@
+<?php
+
+interface PhabricatorUnlockableInterface {
+
+ public function newUnlockEngine();
+
+}
+
+// TEMPLATE IMPLEMENTATION /////////////////////////////////////////////////////
+
+/* -( PhabricatorUnlockableInterface )------------------------------------- */
+/*
+
+ public function newUnlockEngine() {
+ return new <<<...>>>UnlockEngine();
+ }
+
+*/
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 16, 1:26 AM (3 d, 5 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7704933
Default Alt Text
D20257.id48364.diff (5 KB)
Attached To
Mode
D20257: Allow objects to specify custom policy unlocking behavior, and tasks to have owners unlocked
Attached
Detach File
Event Timeline
Log In to Comment