Differential D21547 Diff 51290 src/applications/subscriptions/engineextension/PhabricatorSubscriptionsCurtainExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/subscriptions/engineextension/PhabricatorSubscriptionsCurtainExtension.php
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | public function buildCurtainPanel($object) { | ||||
| } | } | ||||
| // If we didn't load handles earlier because we had too many PHIDs, | // If we didn't load handles earlier because we had too many PHIDs, | ||||
| // load them now. | // load them now. | ||||
| if ($handles === null) { | if ($handles === null) { | ||||
| $handles = $viewer->loadHandles($visible_phids); | $handles = $viewer->loadHandles($visible_phids); | ||||
| } | } | ||||
| PhabricatorPolicyFilterSet::loadHandleViewCapabilities( | |||||
| $viewer, | |||||
| $handles, | |||||
| array($object)); | |||||
| $ref_list = id(new PHUICurtainObjectRefListView()) | $ref_list = id(new PHUICurtainObjectRefListView()) | ||||
| ->setViewer($viewer) | ->setViewer($viewer) | ||||
| ->setEmptyMessage(pht('None')); | ->setEmptyMessage(pht('None')); | ||||
| foreach ($visible_phids as $phid) { | foreach ($visible_phids as $phid) { | ||||
| $handle = $handles[$phid]; | |||||
| $ref = $ref_list->newObjectRefView() | $ref = $ref_list->newObjectRefView() | ||||
| ->setHandle($handles[$phid]); | ->setHandle($handle); | ||||
| if ($phid === $viewer_phid) { | if ($phid === $viewer_phid) { | ||||
| $ref->setHighlighted(true); | $ref->setHighlighted(true); | ||||
| } | } | ||||
| if ($handle->hasCapabilities()) { | |||||
| if (!$handle->hasViewCapability($object)) { | |||||
| $ref->setExiled(true); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| if ($show_all) { | if ($show_all) { | ||||
| $view_all_uri = urisprintf( | $view_all_uri = urisprintf( | ||||
| '/subscriptions/list/%s/', | '/subscriptions/list/%s/', | ||||
| $object_phid); | $object_phid); | ||||
| $ref_list->newTailLink() | $ref_list->newTailLink() | ||||
| ▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines | |||||