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:
@@ -67,15 +67,10 @@ final class PholioMockViewController extends PholioController {
|
||||
|
||||
$title = $mock->getName();
|
||||
|
||||
$descriptions = PhabricatorPolicyQuery::renderPolicyDescriptions(
|
||||
$user,
|
||||
$mock,
|
||||
$icon = true);
|
||||
|
||||
$header = id(new PHUIHeaderView())
|
||||
->setHeader($title)
|
||||
->addProperty(PHUIHeaderView::PROPERTY_POLICY,
|
||||
$descriptions[PhabricatorPolicyCapability::CAN_VIEW]);
|
||||
->setUser($user)
|
||||
->setPolicyObject($mock);
|
||||
|
||||
$actions = $this->buildActionView($mock);
|
||||
$properties = $this->buildPropertyView($mock, $engine);
|
||||
|
||||
Reference in New Issue
Block a user