Page MenuHomePhabricator

D11584.id27878.diff
No OneTemporary

D11584.id27878.diff

diff --git a/src/applications/diffusion/conduit/DiffusionFindSymbolsConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionFindSymbolsConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionFindSymbolsConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionFindSymbolsConduitAPIMethod.php
@@ -37,7 +37,8 @@
$language = $request->getValue('language');
$type = $request->getValue('type');
- $query = new DiffusionSymbolQuery();
+ $query = id(new DiffusionSymbolQuery())
+ ->setViewer($request->getUser());
if ($name !== null) {
$query->setName($name);
}
diff --git a/src/applications/diffusion/controller/DiffusionSymbolController.php b/src/applications/diffusion/controller/DiffusionSymbolController.php
--- a/src/applications/diffusion/controller/DiffusionSymbolController.php
+++ b/src/applications/diffusion/controller/DiffusionSymbolController.php
@@ -8,8 +8,9 @@
$user = $request->getUser();
$this->name = $request->getURIData('name');
- $query = new DiffusionSymbolQuery();
- $query->setName($this->name);
+ $query = id(new DiffusionSymbolQuery())
+ ->setViewer($user)
+ ->setName($this->name);
if ($request->getStr('context') !== null) {
$query->setContext($request->getStr('context'));
diff --git a/src/applications/diffusion/query/DiffusionSymbolQuery.php b/src/applications/diffusion/query/DiffusionSymbolQuery.php
--- a/src/applications/diffusion/query/DiffusionSymbolQuery.php
+++ b/src/applications/diffusion/query/DiffusionSymbolQuery.php
@@ -11,6 +11,7 @@
*/
final class DiffusionSymbolQuery extends PhabricatorOffsetPagedQuery {
+ private $viewer;
private $context;
private $namePrefix;
private $name;
@@ -26,6 +27,20 @@
/* -( Configuring the Query )---------------------------------------------- */
+ /**
+ * @task config
+ */
+ public function setViewer(PhabricatorUser $viewer) {
+ $this->viewer = $viewer;
+ return $this;
+ }
+
+ /**
+ * @task config
+ */
+ public function getViewer() {
+ return $this->viewer;
+ }
/**
* @task config
@@ -263,10 +278,10 @@
$repo_ids = array_filter($repo_ids);
if ($repo_ids) {
- // TODO: (T603) Provide a viewer here.
- $repos = id(new PhabricatorRepository())->loadAllWhere(
- 'id IN (%Ld)',
- $repo_ids);
+ $repos = id(new PhabricatorRepositoryQuery())
+ ->setViewer($this->getViewer())
+ ->withIDs($repo_ids)
+ ->execute();
} else {
$repos = array();
}
diff --git a/src/applications/diffusion/typeahead/DiffusionSymbolDatasource.php b/src/applications/diffusion/typeahead/DiffusionSymbolDatasource.php
--- a/src/applications/diffusion/typeahead/DiffusionSymbolDatasource.php
+++ b/src/applications/diffusion/typeahead/DiffusionSymbolDatasource.php
@@ -19,6 +19,7 @@
if (strlen($raw_query)) {
$symbols = id(new DiffusionSymbolQuery())
+ ->setViewer($viewer)
->setNamePrefix($raw_query)
->setLimit(15)
->needArcanistProjects(true)

File Metadata

Mime Type
text/plain
Expires
Tue, Mar 18, 10:21 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7680155
Default Alt Text
D11584.id27878.diff (3 KB)

Event Timeline