コード例 #1
0
 private function buildObjectSection(PhabricatorPolicyInterface $object, PhabricatorPolicy $policy, $capability, PhabricatorObjectHandle $handle)
 {
     $viewer = $this->getViewer();
     $capability_name = $this->getCapabilityName($capability);
     $object_section = id(new PHUIPolicySectionView())->setViewer($viewer)->setIcon($handle->getIcon() . ' bluegrey')->setHeader(pht('Object Policy'))->appendList(array(array(phutil_tag('strong', array(), pht('%s:', $capability_name)), ' ', $policy->getShortName())))->appendParagraph(pht('In detail, this means that these users can take this action, ' . 'provided they pass all of the checks described above first:'))->appendList(array(PhabricatorPolicy::getPolicyExplanation($viewer, $policy->getPHID())));
     $strength = $this->getStrengthInformation($object, $policy, $capability);
     if ($strength) {
         $object_section->appendHint($strength);
     }
     return $object_section;
 }