From 8cbfb386bb87a8d945a507a0ff16bd084878f442 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 27 Feb 2018 14:10:29 -0800 Subject: [PATCH] When evaluating the "Branches" Herald field from the test console, use the current viewer Summary: Ref T13093. Depends on D19145. See PHI398. Previously, see D18933. This provides the current viewer to `ConduitCall` so that we don't try to use device credentials from unprivileged web hosts. Test Plan: Evaluated the "Branches" field locally, saw an appropriate field value. Maniphest Tasks: T13093 Differential Revision: https://secure.phabricator.com/D19146 --- .../diffusion/herald/DiffusionCommitBranchesHeraldField.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php b/src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php index 03c4e3be62..064830ebc3 100644 --- a/src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php +++ b/src/applications/diffusion/herald/DiffusionCommitBranchesHeraldField.php @@ -10,6 +10,8 @@ final class DiffusionCommitBranchesHeraldField } public function getHeraldFieldValue($object) { + $viewer = $this->getAdapter()->getViewer(); + $commit = $object; $repository = $object->getRepository(); @@ -19,7 +21,7 @@ final class DiffusionCommitBranchesHeraldField ); $result = id(new ConduitCall('diffusion.branchquery', $params)) - ->setUser(PhabricatorUser::getOmnipotentUser()) + ->setUser($viewer) ->execute(); $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result);