From 4df072cca68828fe0ab7bfe6f22e95e750cf7f0c Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 16 Dec 2016 06:58:40 -0800 Subject: [PATCH] Remove "DifferentialEditPolicyField" custom field Summary: Ref T11114. This is now entirely handled by EditEngine and standard policy code. Test Plan: Edited the edit policy of a revision. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17074 --- src/__phutil_library_map__.php | 2 - .../PhabricatorDifferentialConfigOptions.php | 1 - .../DifferentialEditPolicyField.php | 50 ------------------- 3 files changed, 53 deletions(-) delete mode 100644 src/applications/differential/customfield/DifferentialEditPolicyField.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 16a49b364b..c2da058d1c 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -431,7 +431,6 @@ phutil_register_library_map(array( 'DifferentialDiffViewController' => 'applications/differential/controller/DifferentialDiffViewController.php', 'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php', 'DifferentialDraft' => 'applications/differential/storage/DifferentialDraft.php', - 'DifferentialEditPolicyField' => 'applications/differential/customfield/DifferentialEditPolicyField.php', 'DifferentialExactUserFunctionDatasource' => 'applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php', 'DifferentialFieldParseException' => 'applications/differential/exception/DifferentialFieldParseException.php', 'DifferentialFieldValidationException' => 'applications/differential/exception/DifferentialFieldValidationException.php', @@ -5082,7 +5081,6 @@ phutil_register_library_map(array( 'DifferentialDiffViewController' => 'DifferentialController', 'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'DoorkeeperFeedStoryPublisher', 'DifferentialDraft' => 'DifferentialDAO', - 'DifferentialEditPolicyField' => 'DifferentialCoreCustomField', 'DifferentialExactUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'DifferentialFieldParseException' => 'Exception', 'DifferentialFieldValidationException' => 'Exception', diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index 0e7a22e86c..d09807e586 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -37,7 +37,6 @@ final class PhabricatorDifferentialConfigOptions new DifferentialRepositoryField(), new DifferentialProjectsField(), new DifferentialViewPolicyField(), - new DifferentialEditPolicyField(), new DifferentialParentRevisionsField(), new DifferentialManiphestTasksField(), diff --git a/src/applications/differential/customfield/DifferentialEditPolicyField.php b/src/applications/differential/customfield/DifferentialEditPolicyField.php deleted file mode 100644 index 8175fa2b5b..0000000000 --- a/src/applications/differential/customfield/DifferentialEditPolicyField.php +++ /dev/null @@ -1,50 +0,0 @@ -getEditPolicy(); - } - - public function readValueFromRequest(AphrontRequest $request) { - $this->setValue($request->getStr($this->getFieldKey())); - } - - public function renderEditControl(array $handles) { - $viewer = $this->getViewer(); - $revision = $this->getObject(); - - $policies = id(new PhabricatorPolicyQuery()) - ->setViewer($viewer) - ->setObject($revision) - ->execute(); - - return id(new AphrontFormPolicyControl()) - ->setUser($viewer) - ->setCapability(PhabricatorPolicyCapability::CAN_EDIT) - ->setPolicyObject($revision) - ->setPolicies($policies) - ->setName($this->getFieldKey()) - ->setValue($this->getValue()) - ->setError($this->getFieldError()); - } - - public function getApplicationTransactionType() { - return PhabricatorTransactions::TYPE_EDIT_POLICY; - } - -}