diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 4002a21eb0..c8deab4cd2 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -428,7 +428,6 @@ phutil_register_library_map(array( 'DifferentialUnitFieldSpecification' => 'applications/differential/field/specification/DifferentialUnitFieldSpecification.php', 'DifferentialUnitStatus' => 'applications/differential/constants/DifferentialUnitStatus.php', 'DifferentialUnitTestResult' => 'applications/differential/constants/DifferentialUnitTestResult.php', - 'DifferentialViewPolicyFieldSpecification' => 'applications/differential/field/specification/DifferentialViewPolicyFieldSpecification.php', 'DiffusionBranchInformation' => 'applications/diffusion/data/DiffusionBranchInformation.php', 'DiffusionBranchTableController' => 'applications/diffusion/controller/DiffusionBranchTableController.php', 'DiffusionBranchTableView' => 'applications/diffusion/view/DiffusionBranchTableView.php', @@ -2500,7 +2499,6 @@ phutil_register_library_map(array( 'DifferentialTransaction' => 'PhabricatorApplicationTransaction', 'DifferentialTransactionComment' => 'PhabricatorApplicationTransactionComment', 'DifferentialUnitFieldSpecification' => 'DifferentialFieldSpecification', - 'DifferentialViewPolicyFieldSpecification' => 'DifferentialFieldSpecification', 'DiffusionBranchTableController' => 'DiffusionController', 'DiffusionBranchTableView' => 'DiffusionView', 'DiffusionBrowseController' => 'DiffusionController', diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php index 0ec596ef74..54750a094b 100644 --- a/src/applications/differential/controller/DifferentialRevisionViewController.php +++ b/src/applications/differential/controller/DifferentialRevisionViewController.php @@ -232,6 +232,7 @@ final class DifferentialRevisionViewController extends DifferentialController { } $revision_detail = id(new DifferentialRevisionDetailView()) + ->setUser($user) ->setRevision($revision) ->setDiff(end($diffs)) ->setAuxiliaryFields($aux_fields) diff --git a/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php b/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php index 0d4d7eec45..a1a2ceea2d 100644 --- a/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php +++ b/src/applications/differential/field/selector/DifferentialDefaultFieldSelector.php @@ -13,7 +13,6 @@ final class DifferentialDefaultFieldSelector new DifferentialReviewersFieldSpecification(), new DifferentialReviewedByFieldSpecification(), new DifferentialCCsFieldSpecification(), - new DifferentialViewPolicyFieldSpecification(), new DifferentialLintFieldSpecification(), new DifferentialUnitFieldSpecification(), new DifferentialCommitsFieldSpecification(), diff --git a/src/applications/differential/field/specification/DifferentialViewPolicyFieldSpecification.php b/src/applications/differential/field/specification/DifferentialViewPolicyFieldSpecification.php deleted file mode 100644 index 52235eb3e4..0000000000 --- a/src/applications/differential/field/specification/DifferentialViewPolicyFieldSpecification.php +++ /dev/null @@ -1,25 +0,0 @@ -getUser(); - $revision = $this->getRevision(); - - $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( - $user, - $revision); - - return idx($descriptions, PhabricatorPolicyCapability::CAN_VIEW); - } - -} diff --git a/src/applications/differential/view/DifferentialRevisionDetailView.php b/src/applications/differential/view/DifferentialRevisionDetailView.php index ee7b585721..8fc52c2d80 100644 --- a/src/applications/differential/view/DifferentialRevisionDetailView.php +++ b/src/applications/differential/view/DifferentialRevisionDetailView.php @@ -120,7 +120,9 @@ final class DifferentialRevisionDetailView extends AphrontView { private function renderHeader(DifferentialRevision $revision) { $view = id(new PHUIHeaderView()) - ->setHeader($revision->getTitle($revision)); + ->setHeader($revision->getTitle($revision)) + ->setUser($this->getUser()) + ->setPolicyObject($revision); $status = $revision->getStatus(); $status_name =