Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15437835
D11584.id27878.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11584.id27878.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 26, 9:45 PM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7680155
Default Alt Text
D11584.id27878.diff (3 KB)
Attached To
Mode
D11584: Policy - lock down DiffusionSymbolQuery repo-loading code
Attached
Detach File
Event Timeline
Log In to Comment