@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.

Pass viewer to all ManiphestTaskQuery objects

Summary: Ref T603. Prepare for conversion to a policy-aware query.

Test Plan: Browsed various interfaces which use this stuff.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

+25 -16
+1
src/applications/differential/field/specification/DifferentialFreeformFieldSpecification.php
··· 227 227 } 228 228 229 229 $tasks = id(new ManiphestTaskQuery()) 230 + ->setViewer($user) 230 231 ->withTaskIDs(array_keys($tasks_statuses)) 231 232 ->execute(); 232 233
+17 -16
src/applications/directory/controller/PhabricatorDirectoryMainController.php
··· 98 98 99 99 private function buildUnbreakNowPanel() { 100 100 $user = $this->getRequest()->getUser(); 101 - $user_phid = $user->getPHID(); 102 101 103 - $task_query = new ManiphestTaskQuery(); 104 - $task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN); 105 - $task_query->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW); 106 - $task_query->setLimit(10); 102 + $task_query = id(new ManiphestTaskQuery()) 103 + ->setViewer($user) 104 + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 105 + ->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW) 106 + ->setLimit(10); 107 107 108 108 $tasks = $task_query->execute(); 109 109 ··· 135 135 assert_instances_of($projects, 'PhabricatorProject'); 136 136 137 137 $user = $this->getRequest()->getUser(); 138 - $user_phid = $user->getPHID(); 139 138 140 139 if ($projects) { 141 - $task_query = new ManiphestTaskQuery(); 142 - $task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN); 143 - $task_query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE); 144 - $task_query->withAnyProjects(mpull($projects, 'getPHID')); 145 - $task_query->setLimit(10); 140 + $task_query = id(new ManiphestTaskQuery()) 141 + ->setViewer($user) 142 + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 143 + ->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE) 144 + ->withAnyProjects(mpull($projects, 'getPHID')) 145 + ->setLimit(10); 146 146 $tasks = $task_query->execute(); 147 147 } else { 148 148 $tasks = array(); ··· 249 249 $user = $this->getRequest()->getUser(); 250 250 $user_phid = $user->getPHID(); 251 251 252 - $task_query = new ManiphestTaskQuery(); 253 - $task_query->withStatus(ManiphestTaskQuery::STATUS_OPEN); 254 - $task_query->setGroupBy(ManiphestTaskQuery::GROUP_PRIORITY); 255 - $task_query->withOwners(array($user_phid)); 256 - $task_query->setLimit(10); 252 + $task_query = id(new ManiphestTaskQuery()) 253 + ->setViewer($user) 254 + ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 255 + ->setGroupBy(ManiphestTaskQuery::GROUP_PRIORITY) 256 + ->withOwners(array($user_phid)) 257 + ->setLimit(10); 257 258 258 259 $tasks = $task_query->execute(); 259 260
+2
src/applications/maniphest/application/PhabricatorApplicationManiphest.php
··· 83 83 $status = array(); 84 84 85 85 $query = id(new ManiphestTaskQuery()) 86 + ->setViewer($user) 86 87 ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 87 88 ->withPriority(ManiphestTaskPriority::PRIORITY_UNBREAK_NOW) 88 89 ->setLimit(1) ··· 97 98 ->setCount($count); 98 99 99 100 $query = id(new ManiphestTaskQuery()) 101 + ->setViewer($user) 100 102 ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 101 103 ->withOwners(array($user->getPHID())) 102 104 ->setLimit(1)
+2
src/applications/maniphest/conduit/ConduitAPI_maniphest_query_Method.php
··· 65 65 protected function execute(ConduitAPIRequest $request) { 66 66 $query = new ManiphestTaskQuery(); 67 67 68 + $query->setViewer($request->getUser()); 69 + 68 70 $task_ids = $request->getValue('ids'); 69 71 if ($task_ids) { 70 72 $query->withTaskIDs($task_ids);
+1
src/applications/maniphest/controller/ManiphestReportController.php
··· 386 386 387 387 388 388 $query = id(new ManiphestTaskQuery()) 389 + ->setViewer($user) 389 390 ->withStatus(ManiphestTaskQuery::STATUS_OPEN); 390 391 391 392 $project_phid = $request->getStr('project');
+1
src/applications/maniphest/controller/ManiphestTaskListController.php
··· 459 459 ManiphestTaskPriority::getHighestPriority()); 460 460 461 461 $query = new ManiphestTaskQuery(); 462 + $query->setViewer($viewer); 462 463 $query->withTaskIDs($task_ids); 463 464 464 465 if ($project_phids) {
+1
src/applications/project/controller/PhabricatorProjectProfileController.php
··· 154 154 $user = $this->getRequest()->getUser(); 155 155 156 156 $query = id(new ManiphestTaskQuery()) 157 + ->setViewer($user) 157 158 ->withAnyProjects(array($project->getPHID())) 158 159 ->withStatus(ManiphestTaskQuery::STATUS_OPEN) 159 160 ->setOrderBy(ManiphestTaskQuery::ORDER_PRIORITY)