diff --git a/src/applications/diffusion/herald/HeraldCommitAdapter.php b/src/applications/diffusion/herald/HeraldCommitAdapter.php index e0e15352b6..fc3c8c4f5b 100644 --- a/src/applications/diffusion/herald/HeraldCommitAdapter.php +++ b/src/applications/diffusion/herald/HeraldCommitAdapter.php @@ -135,13 +135,16 @@ final class HeraldCommitAdapter } public function loadAffectedPaths() { + $viewer = $this->getViewer(); + if ($this->affectedPaths === null) { $result = PhabricatorOwnerPathQuery::loadAffectedPaths( $this->getRepository(), $this->commit, - PhabricatorUser::getOmnipotentUser()); + $viewer); $this->affectedPaths = $result; } + return $this->affectedPaths; } @@ -172,6 +175,8 @@ final class HeraldCommitAdapter } public function loadDifferentialRevision() { + $viewer = $this->getViewer(); + if ($this->affectedRevision === null) { $this->affectedRevision = false; @@ -189,7 +194,7 @@ final class HeraldCommitAdapter $revision = id(new DifferentialRevisionQuery()) ->withIDs(array($revision_id)) - ->setViewer(PhabricatorUser::getOmnipotentUser()) + ->setViewer($viewer) ->needReviewers(true) ->executeOne(); if ($revision) { @@ -197,6 +202,7 @@ final class HeraldCommitAdapter } } } + return $this->affectedRevision; } @@ -323,7 +329,7 @@ final class HeraldCommitAdapter } private function callConduit($method, array $params) { - $viewer = PhabricatorUser::getOmnipotentUser(); + $viewer = $this->getViewer(); $drequest = DiffusionRequest::newFromDictionary( array(