Page MenuHomePhabricator

D16840.diff
No OneTemporary

D16840.diff

diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php
--- a/src/applications/project/query/PhabricatorProjectQuery.php
+++ b/src/applications/project/query/PhabricatorProjectQuery.php
@@ -260,14 +260,14 @@
$all_graph = $this->getAllReachableAncestors($projects);
- if ($this->needAncestorMembers || $this->needWatchers) {
- $src_projects = $all_graph;
- } else {
- $src_projects = $projects;
- }
+ // NOTE: Although we may not need much information about ancestors, we
+ // always need to test if the viewer is a member, because we will return
+ // ancestor projects to the policy filter via ExtendedPolicy calls. If
+ // we skip populating membership data on a parent, the policy framework
+ // will think the user is not a member of the parent project.
$all_sources = array();
- foreach ($src_projects as $project) {
+ foreach ($all_graph as $project) {
// For milestones, we need parent members.
if ($project->isMilestone()) {
$parent_phid = $project->getParentProjectPHID();
@@ -306,7 +306,7 @@
}
$membership_projects = array();
- foreach ($src_projects as $project) {
+ foreach ($all_graph as $project) {
$project_phid = $project->getPHID();
if ($project->isMilestone()) {

File Metadata

Mime Type
text/plain
Expires
Sun, May 12, 5:13 AM (2 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6289698
Default Alt Text
D16840.diff (1 KB)

Event Timeline