From f552a20c6193ac9ffc4fca8d2a56d724c33cb813 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 16 Dec 2016 09:19:55 -0800 Subject: [PATCH] Remove Differential "View Policy" field Summary: Ref T11114. Obsoleted by EditEngine. Test Plan: Edited the view policy of a revision. Reviewers: chad Reviewed By: chad Maniphest Tasks: T11114 Differential Revision: https://secure.phabricator.com/D17082 --- src/__phutil_library_map__.php | 2 - .../PhabricatorDifferentialConfigOptions.php | 1 - .../DifferentialViewPolicyField.php | 50 ------------------- 3 files changed, 53 deletions(-) delete mode 100644 src/applications/differential/customfield/DifferentialViewPolicyField.php diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index a1f8f3582a..8abf50a49f 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -582,7 +582,6 @@ phutil_register_library_map(array( 'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php', 'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php', 'DifferentialUpdateRevisionConduitAPIMethod' => 'applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php', - 'DifferentialViewPolicyField' => 'applications/differential/customfield/DifferentialViewPolicyField.php', 'DiffusionAuditorDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorDatasource.php', 'DiffusionAuditorFunctionDatasource' => 'applications/diffusion/typeahead/DiffusionAuditorFunctionDatasource.php', 'DiffusionAuditorsAddAuditorsHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsAddAuditorsHeraldAction.php', @@ -5247,7 +5246,6 @@ phutil_register_library_map(array( 'DifferentialUnitStatus' => 'Phobject', 'DifferentialUnitTestResult' => 'Phobject', 'DifferentialUpdateRevisionConduitAPIMethod' => 'DifferentialConduitAPIMethod', - 'DifferentialViewPolicyField' => 'DifferentialCoreCustomField', 'DiffusionAuditorDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'DiffusionAuditorFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource', 'DiffusionAuditorsAddAuditorsHeraldAction' => 'DiffusionAuditorsHeraldAction', diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php index 4b87d38d38..8f61f235b0 100644 --- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php +++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php @@ -31,7 +31,6 @@ final class PhabricatorDifferentialConfigOptions new DifferentialReviewersField(), new DifferentialProjectReviewersField(), new DifferentialRepositoryField(), - new DifferentialViewPolicyField(), new DifferentialManiphestTasksField(), new DifferentialCommitsField(), diff --git a/src/applications/differential/customfield/DifferentialViewPolicyField.php b/src/applications/differential/customfield/DifferentialViewPolicyField.php deleted file mode 100644 index 9b17413fcf..0000000000 --- a/src/applications/differential/customfield/DifferentialViewPolicyField.php +++ /dev/null @@ -1,50 +0,0 @@ -getViewPolicy(); - } - - 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_VIEW) - ->setPolicyObject($revision) - ->setPolicies($policies) - ->setName($this->getFieldKey()) - ->setValue($this->getValue()) - ->setError($this->getFieldError()); - } - - public function getApplicationTransactionType() { - return PhabricatorTransactions::TYPE_VIEW_POLICY; - } - -}