Page MenuHomePhabricator

D11005.diff
No OneTemporary

D11005.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
Oct 15 2024, 7:12 AM (5 w, 2 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6711865
Default Alt Text
D11005.diff (1 KB)

Event Timeline