Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14446248
D19225.id46030.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
D19225.id46030.diff
View Options
diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
--- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php
@@ -284,9 +284,6 @@
$edit_config = $edit_engine->loadDefaultEditConfiguration($task);
$can_create = (bool)$edit_config;
- $can_reassign = $edit_engine->hasEditAccessToTransaction(
- ManiphestTaskOwnerTransaction::TRANSACTIONTYPE);
-
if ($can_create) {
$form_key = $edit_config->getIdentifier();
$edit_uri = id(new PhutilURI("/task/edit/form/{$form_key}/"))
diff --git a/src/applications/transactions/editengine/PhabricatorEditEngine.php b/src/applications/transactions/editengine/PhabricatorEditEngine.php
--- a/src/applications/transactions/editengine/PhabricatorEditEngine.php
+++ b/src/applications/transactions/editengine/PhabricatorEditEngine.php
@@ -1398,59 +1398,6 @@
}
- /**
- * Test if the viewer could apply a certain type of change by using the
- * normal "Edit" form.
- *
- * This method returns `true` if the user has access to an edit form and
- * that edit form has a field which applied the specified transaction type,
- * and that field is visible and editable for the user.
- *
- * For example, you can use it to test if a user is able to reassign tasks
- * or not, prior to rendering dedicated UI for task reassignment.
- *
- * Note that this method does NOT test if the user can actually edit the
- * current object, just if they have access to the related field.
- *
- * @param const Transaction type to test for.
- * @return bool True if the user could "Edit" to apply the transaction type.
- */
- final public function hasEditAccessToTransaction($xaction_type) {
- $viewer = $this->getViewer();
-
- $object = $this->getTargetObject();
- if (!$object) {
- $object = $this->newEditableObject();
- }
-
- $config = $this->loadDefaultEditConfiguration($object);
- if (!$config) {
- return false;
- }
-
- $fields = $this->buildEditFields($object);
-
- $field = null;
- foreach ($fields as $form_field) {
- $field_xaction_type = $form_field->getTransactionType();
- if ($field_xaction_type === $xaction_type) {
- $field = $form_field;
- break;
- }
- }
-
- if (!$field) {
- return false;
- }
-
- if (!$field->shouldReadValueFromSubmit()) {
- return false;
- }
-
- return true;
- }
-
-
public function newNUXButton($text) {
$specs = $this->newCreateActionSpecifications(array());
$head = head($specs);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 27, 1:12 PM (2 h, 12 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6931910
Default Alt Text
D19225.id46030.diff (2 KB)
Attached To
Mode
D19225: Don't make an expensive, unused call to test if a viewer can reassign a task
Attached
Detach File
Event Timeline
Log In to Comment