Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15343266
D13289.id32130.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D13289.id32130.diff
View Options
diff --git a/src/applications/diffusion/query/DiffusionCommitQuery.php b/src/applications/diffusion/query/DiffusionCommitQuery.php
--- a/src/applications/diffusion/query/DiffusionCommitQuery.php
+++ b/src/applications/diffusion/query/DiffusionCommitQuery.php
@@ -193,6 +193,7 @@
if ($repo) {
$commit->attachRepository($repo);
} else {
+ $this->didRejectResult($commit);
unset($commits[$key]);
continue;
}
diff --git a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php
--- a/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php
+++ b/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php
@@ -338,9 +338,25 @@
}
protected function didRejectResult(PhabricatorPolicyInterface $object) {
+ // Some objects (like commits) may be rejected because related objects
+ // (like repositories) can not be loaded. In some cases, we may need these
+ // related objects to determine the object policy, so it's expected that
+ // we may occasionally be unable to determine the policy.
+
+ try {
+ $policy = $object->getPolicy(PhabricatorPolicyCapability::CAN_VIEW);
+ } catch (Exception $ex) {
+ $policy = null;
+ }
+
+ // Mark this object as filtered so handles can render "Restricted" instead
+ // of "Unknown".
+ $phid = $object->getPHID();
+ $this->addPolicyFilteredPHIDs(array($phid => $phid));
+
$this->getPolicyFilter()->rejectObject(
$object,
- $object->getPolicy(PhabricatorPolicyCapability::CAN_VIEW),
+ $policy,
PhabricatorPolicyCapability::CAN_VIEW);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 10, 10:16 PM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7332282
Default Alt Text
D13289.id32130.diff (1 KB)
Attached To
Mode
D13289: Call didRejectResult() in DiffusionCommitQuery properly
Attached
Detach File
Event Timeline
Log In to Comment