Add DifferentialDiffQuery and change most callsites

Summary:
Ref T603. This introduces a policy-aware DifferentialDiffQuery and converts most callsites.

I've left unusual callsites (mostly: hard to get the viewer, unusual query, queries related to active diffs) alone for now, so this isn't exhaustive but hits 60-80% of sites.

Test Plan: Created diff; created revision; viewed diffs and revisions; made additional conduit calls.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D6338
This commit is contained in:
epriestley
2013-07-01 12:38:42 -07:00
parent 328aa383e4
commit 90123dd739
14 changed files with 133 additions and 50 deletions

View File

@@ -12,7 +12,10 @@ final class DifferentialDiffViewController extends DifferentialController {
$request = $this->getRequest();
$viewer = $request->getUser();
$diff = id(new DifferentialDiff())->load($this->id);
$diff = id(new DifferentialDiffQuery())
->setViewer($viewer)
->withIDs(array($this->id))
->executeOne();
if (!$diff) {
return new Aphront404Response();
}