Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14002876
D11005.id.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
D11005.id.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11005: Don't skip policy checks on ObjectQuery if special capabilities are required
Attached
Detach File
Event Timeline
Log In to Comment