Page MenuHomePhabricator

D11005.id.diff
No OneTemporary

D11005.id.diff

diff --git a/src/applications/phid/query/PhabricatorObjectQuery.php b/src/applications/phid/query/PhabricatorObjectQuery.php
--- a/src/applications/phid/query/PhabricatorObjectQuery.php
+++ b/src/applications/phid/query/PhabricatorObjectQuery.php
@@ -144,12 +144,18 @@
}
/**
- * This query disables policy filtering because it is performed in the
- * subqueries which actually load objects. We don't need to re-filter
- * results, since policies have already been applied.
+ * This query disables policy filtering if the only required capability is
+ * the view capability.
+ *
+ * The view capability is always checked in the subqueries, so we do not need
+ * to re-filter results. For any other set of required capabilities, we do.
*/
protected function shouldDisablePolicyFiltering() {
- return true;
+ $view_capability = PhabricatorPolicyCapability::CAN_VIEW;
+ if ($this->getRequiredCapabilities() === array($view_capability)) {
+ return true;
+ }
+ return false;
}
public function getQueryApplicationClass() {

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 26, 11:25 PM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711865
Default Alt Text
D11005.id.diff (1 KB)

Event Timeline