@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Use a policy-aware query for Project typeahead

Summary: Fixes T2677. Currently, you can typeahead projects you can't see.

Test Plan: Typeahead'ed projects. Verified active projects appeared; archived did not.

Reviewers: chad

Reviewed By: chad

CC: aran

Maniphest Tasks: T2677

Differential Revision: https://secure.phabricator.com/D5242

+5 -3
+5 -3
src/applications/typeahead/controller/PhabricatorTypeaheadCommonDatasourceController.php
··· 12 12 public function processRequest() { 13 13 14 14 $request = $this->getRequest(); 15 + $viewer = $request->getUser(); 15 16 $query = $request->getStr('q'); 16 17 17 18 $need_rich_data = false; ··· 199 200 } 200 201 201 202 if ($need_projs) { 202 - $projs = id(new PhabricatorProject())->loadAllWhere( 203 - 'status != %d', 204 - PhabricatorProjectStatus::STATUS_ARCHIVED); 203 + $projs = id(new PhabricatorProjectQuery()) 204 + ->setViewer($viewer) 205 + ->withStatus(PhabricatorProjectQuery::STATUS_OPEN) 206 + ->execute(); 205 207 foreach ($projs as $proj) { 206 208 $results[] = id(new PhabricatorTypeaheadResult()) 207 209 ->setName($proj->getName())