Page MenuHomePhabricator

PhrictionDocumentQuery still has a project-respecting hunk of code
Closed, ResolvedPublic

Description

I think we can nuke this thing, but you're more familiar with the code now than I am:

foreach ($documents as $document) {
  $document->attachProject(null);
}

$project_slugs = array();
foreach ($documents as $key => $document) {
  $slug = $document->getSlug();
  if (!PhrictionDocument::isProjectSlug($slug)) {
    continue;
  }
  $project_slugs[$key] = PhrictionDocument::getProjectSlugIdentifier($slug);
}

if ($project_slugs) {
  $projects = id(new PhabricatorProjectQuery())
    ->setViewer($this->getViewer())
    ->withPhrictionSlugs($project_slugs)
    ->execute();
  $projects = mpull($projects, null, 'getPhrictionSlug');
  foreach ($documents as $key => $document) {
    $slug = idx($project_slugs, $key);
    if ($slug) {
      $project = idx($projects, $slug);
      if (!$project) {
        unset($documents[$key]);
        continue;
      }
      $document->attachProject($project);
    }
  }
}

Specifically, this means that project pages still have an aura of magic to them -- for example, I can't view this page:

https://secure.phabricator.com/w/projects/private11/

...even though the document has public/users policies.

Revisions and Commits

Restricted Differential Revision

Event Timeline

epriestley raised the priority of this task from to Normal.
epriestley updated the task description. (Show Details)
epriestley added projects: Phriction, Policy.
epriestley added subscribers: epriestley, btrahan.
btrahan added a revision: Restricted Differential Revision.Nov 8 2014, 2:11 AM
btrahan added a commit: Restricted Diffusion Commit.

Closed by commit rPb655699a6cfb.