mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 22:10:55 +01:00
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
This commit is contained in:
parent
bc6522dbca
commit
4df072cca6
3 changed files with 0 additions and 53 deletions
|
@ -431,7 +431,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialDiffViewController' => 'applications/differential/controller/DifferentialDiffViewController.php',
|
'DifferentialDiffViewController' => 'applications/differential/controller/DifferentialDiffViewController.php',
|
||||||
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php',
|
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'applications/differential/doorkeeper/DifferentialDoorkeeperRevisionFeedStoryPublisher.php',
|
||||||
'DifferentialDraft' => 'applications/differential/storage/DifferentialDraft.php',
|
'DifferentialDraft' => 'applications/differential/storage/DifferentialDraft.php',
|
||||||
'DifferentialEditPolicyField' => 'applications/differential/customfield/DifferentialEditPolicyField.php',
|
|
||||||
'DifferentialExactUserFunctionDatasource' => 'applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php',
|
'DifferentialExactUserFunctionDatasource' => 'applications/differential/typeahead/DifferentialExactUserFunctionDatasource.php',
|
||||||
'DifferentialFieldParseException' => 'applications/differential/exception/DifferentialFieldParseException.php',
|
'DifferentialFieldParseException' => 'applications/differential/exception/DifferentialFieldParseException.php',
|
||||||
'DifferentialFieldValidationException' => 'applications/differential/exception/DifferentialFieldValidationException.php',
|
'DifferentialFieldValidationException' => 'applications/differential/exception/DifferentialFieldValidationException.php',
|
||||||
|
@ -5082,7 +5081,6 @@ phutil_register_library_map(array(
|
||||||
'DifferentialDiffViewController' => 'DifferentialController',
|
'DifferentialDiffViewController' => 'DifferentialController',
|
||||||
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'DoorkeeperFeedStoryPublisher',
|
'DifferentialDoorkeeperRevisionFeedStoryPublisher' => 'DoorkeeperFeedStoryPublisher',
|
||||||
'DifferentialDraft' => 'DifferentialDAO',
|
'DifferentialDraft' => 'DifferentialDAO',
|
||||||
'DifferentialEditPolicyField' => 'DifferentialCoreCustomField',
|
|
||||||
'DifferentialExactUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
'DifferentialExactUserFunctionDatasource' => 'PhabricatorTypeaheadCompositeDatasource',
|
||||||
'DifferentialFieldParseException' => 'Exception',
|
'DifferentialFieldParseException' => 'Exception',
|
||||||
'DifferentialFieldValidationException' => 'Exception',
|
'DifferentialFieldValidationException' => 'Exception',
|
||||||
|
|
|
@ -37,7 +37,6 @@ final class PhabricatorDifferentialConfigOptions
|
||||||
new DifferentialRepositoryField(),
|
new DifferentialRepositoryField(),
|
||||||
new DifferentialProjectsField(),
|
new DifferentialProjectsField(),
|
||||||
new DifferentialViewPolicyField(),
|
new DifferentialViewPolicyField(),
|
||||||
new DifferentialEditPolicyField(),
|
|
||||||
|
|
||||||
new DifferentialParentRevisionsField(),
|
new DifferentialParentRevisionsField(),
|
||||||
new DifferentialManiphestTasksField(),
|
new DifferentialManiphestTasksField(),
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
final class DifferentialEditPolicyField
|
|
||||||
extends DifferentialCoreCustomField {
|
|
||||||
|
|
||||||
public function getFieldKey() {
|
|
||||||
return 'differential:edit-policy';
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFieldName() {
|
|
||||||
return pht('Edit Policy');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFieldDescription() {
|
|
||||||
return pht('Controls who can edit a revision.');
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function readValueFromRevision(
|
|
||||||
DifferentialRevision $revision) {
|
|
||||||
return $revision->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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in a new issue