private function renderPolicyDetails(PhabricatorPolicy $policy, array $rule_objects) { $details = array(); $details[] = phutil_tag('p', array('class' => 'policy-transaction-detail-intro'), pht('These rules are processed in order:')); foreach ($policy->getRules() as $index => $rule) { $rule_object = $rule_objects[$rule['rule']]; if ($rule['action'] == 'allow') { $icon = 'fa-check-circle green'; } else { $icon = 'fa-minus-circle red'; } $icon = id(new PHUIIconView())->setIconFont($icon)->setText(ucfirst($rule['action']) . ' ' . $rule_object->getRuleDescription()); $handle_phids = $rule_object->getRequiredHandlePHIDsForSummary($rule['value']); if ($handle_phids) { $value = $this->renderHandlesForPHIDs($handle_phids, ','); } else { $value = $rule['value']; } $details[] = phutil_tag('div', array('class' => 'policy-transaction-detail-row'), array($icon, $value)); } $details[] = phutil_tag('p', array('class' => 'policy-transaction-detail-end'), pht('If no rules match, %s all other users.', phutil_tag('b', array(), $policy->getDefaultAction()))); return $details; }