Index: src/applications/differential/query/DifferentialRevisionQuery.php =================================================================== --- src/applications/differential/query/DifferentialRevisionQuery.php +++ src/applications/differential/query/DifferentialRevisionQuery.php @@ -429,6 +429,13 @@ continue; } + if ($this->getViewer()->isOmnipotent()) { + // The viewer is omnipotent. Allow the revision to load even without + // a repository. + $revision->attachRepository(null); + continue; + } + // The revision has an associated repository, and the viewer can't see // it, and the viewer has no special capabilities. Filter out this // revision. Index: src/applications/policy/filter/PhabricatorPolicyFilter.php =================================================================== --- src/applications/policy/filter/PhabricatorPolicyFilter.php +++ src/applications/policy/filter/PhabricatorPolicyFilter.php @@ -259,6 +259,15 @@ return; } + if ($this->viewer->isOmnipotent()) { + // Never raise policy exceptions for the omnipotent viewer. Although we + // will never normally issue a policy rejection for the omnipotent + // viewer, we can end up here when queries blanket reject objects that + // have failed to load, without distinguishing between nonexistent and + // nonvisible objects. + return; + } + $capobj = PhabricatorPolicyCapability::getCapabilityByKey($capability); $rejection = null; if ($capobj) {