From 387e3fac66bc796d8fd97a44b92fdee94ae78192 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 18 Sep 2013 14:50:39 -0700 Subject: [PATCH] Roll out more Policy Headers --- .../LegalpadDocumentViewController.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/applications/legalpad/controller/LegalpadDocumentViewController.php b/src/applications/legalpad/controller/LegalpadDocumentViewController.php index 4a4a3097b8..4773881e08 100644 --- a/src/applications/legalpad/controller/LegalpadDocumentViewController.php +++ b/src/applications/legalpad/controller/LegalpadDocumentViewController.php @@ -61,8 +61,15 @@ final class LegalpadDocumentViewController extends LegalpadController { $title = $document_body->getTitle(); + $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( + $user, + $document, + true); + $header = id(new PHUIHeaderView()) - ->setHeader($title); + ->setHeader($title) + ->addProperty(PHUIHeaderView::PROPERTY_POLICY, + $descriptions[PhabricatorPolicyCapability::CAN_VIEW]); $actions = $this->buildActionView($document); $properties = $this->buildPropertyView($document, $engine); @@ -174,14 +181,6 @@ final class LegalpadDocumentViewController extends LegalpadController { pht('Contributors'), $contributor_view); - $descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions( - $user, - $document); - - $properties->addProperty( - pht('Visible To'), - $descriptions[PhabricatorPolicyCapability::CAN_VIEW]); - $properties->invokeWillRenderEvent(); return $properties;