Introduce PhabricatorSavedQueryQuery

Summary: Same as D6051, but for SavedQueries instead of NamedQueries. These are POLICY_PUBLIC because you need to know the hash to access them, and because we want to let users copy/paste query URLs. Ref T2625.

Test Plan: Saved a query, reused a saved query.

Reviewers: btrahan, blc

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T2625

Differential Revision: https://secure.phabricator.com/D6054
This commit is contained in:
epriestley
2013-05-27 13:41:20 -07:00
parent dcb5eb8e35
commit 215553c261
5 changed files with 106 additions and 12 deletions

View File

@@ -34,9 +34,10 @@ final class PhabricatorPasteListController extends PhabricatorPasteController {
->setPasteSearchUser($request->getUser());
if ($this->queryKey !== null) {
$saved_query = id(new PhabricatorSavedQuery())->loadOneWhere(
'queryKey = %s',
$this->queryKey);
$saved_query = id(new PhabricatorSavedQueryQuery())
->setViewer($user)
->withQueryKeys(array($this->queryKey))
->executeOne();
if (!$saved_query) {
return new Aphront404Response();