Simplify policy header implementation
Summary: Instead of rendering this in all callers, just pass the object into the header and let it figure out how to format it. Test Plan: Looked at Legalpad, Paste, and Pholio. Reviewers: chad, btrahan Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D7039
This commit is contained in:
@@ -34,11 +34,6 @@ final class PhamePostViewController extends PhameController {
|
||||
$actions = $this->renderActions($post, $user);
|
||||
$properties = $this->renderProperties($post, $user);
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$user,
|
||||
$post,
|
||||
true);
|
||||
|
||||
$crumbs = $this->buildApplicationCrumbs();
|
||||
$crumbs->setActionList($actions);
|
||||
$crumbs->addCrumb(
|
||||
@@ -50,8 +45,8 @@ final class PhamePostViewController extends PhameController {
|
||||
$nav->appendChild(
|
||||
id(new PHUIHeaderView())
|
||||
->setHeader($post->getTitle())
|
||||
->addProperty(PHUIHeaderView::PROPERTY_POLICY,
|
||||
$descriptions[PhabricatorPolicyCapability::CAN_VIEW]));
|
||||
->setUser($user)
|
||||
->setPolicyObject($post));
|
||||
|
||||
if ($post->isDraft()) {
|
||||
$nav->appendChild(
|
||||
|
||||
Reference in New Issue
Block a user