Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/request/DiffusionRequest.php
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Lines | /* -( Creating Requests )-------------------------------------------------- */ | ||||
*/ | */ | ||||
final private static function newFromIdentifier( | final private static function newFromIdentifier( | ||||
$identifier, | $identifier, | ||||
PhabricatorUser $viewer, | PhabricatorUser $viewer, | ||||
$need_edit = false) { | $need_edit = false) { | ||||
$query = id(new PhabricatorRepositoryQuery()) | $query = id(new PhabricatorRepositoryQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withIdentifiers(array($identifier)); | ->withIdentifiers(array($identifier)) | ||||
->needURIs(true); | |||||
if ($need_edit) { | if ($need_edit) { | ||||
$query->requireCapabilities( | $query->requireCapabilities( | ||||
array( | array( | ||||
PhabricatorPolicyCapability::CAN_VIEW, | PhabricatorPolicyCapability::CAN_VIEW, | ||||
PhabricatorPolicyCapability::CAN_EDIT, | PhabricatorPolicyCapability::CAN_EDIT, | ||||
)); | )); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 540 Lines • Show Last 20 Lines |