Page MenuHomePhabricator

Policy - make ManiphestTaskQuery verify project visibility first thing
ClosedPublic

Authored by btrahan on Feb 3 2015, 9:14 PM.
Tags
None
Referenced Files
F13992237: D11660.id.diff
Tue, Oct 22, 3:23 PM
F13983201: D11660.id28068.diff
Oct 20 2024, 4:43 AM
F13954922: D11660.diff
Oct 13 2024, 11:32 PM
Unknown Object (File)
Oct 6 2024, 4:36 PM
Unknown Object (File)
Oct 5 2024, 6:33 AM
Unknown Object (File)
Oct 5 2024, 6:33 AM
Unknown Object (File)
Sep 26 2024, 7:30 PM
Unknown Object (File)
Sep 21 2024, 10:16 PM
Subscribers

Details

Summary

Fixes T7094 (last of many revisions). Its important to do this filtering ASAP so that users can't deduce the identify of an unknown / invisible project.

Test Plan

executed a query for tasks in project foo using user bar. using user foo, lock user bar out of project foo. reissued the query and saw "no data" as well as "restricted project" in the project typeahead.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

btrahan retitled this revision from to Policy - make ManiphestTaskQuery verify project visibility first thing.
btrahan updated this object.
btrahan edited the test plan for this revision. (Show Details)
btrahan added a reviewer: epriestley.
src/applications/maniphest/query/ManiphestTaskQuery.php
270

this is probably not necessary, it just seemed nice to normalize the array indices again

epriestley edited edge metadata.

I think this logic could move to willExecute(), which would mean fewer queries in the event that we need to page several times.

This revision is now accepted and ready to land.Feb 3 2015, 9:38 PM

I think this logic could move to willExecute(), which would mean fewer queries in the event that we need to page several times.

The PhabricatorEmptyQueryException doesn't get caught if you throw it from willExecute. I figure two options

  • no change
  • move code to willExecute, but rather than throw set member variable "projectPolicyCheckFailed". loadPage() then throws the EmptyQueryException if this variable is set

I'll submit the latter for review in a second.

I guess option (3) would be to try/catch for "EmptyQuery" earlier. That also seems reasonable to me, but is a more invasive change.

...haha, I didn't specify that option 'cuz it looks scary. :/

This revision was automatically updated to reflect the committed changes.

Yeah, let's go with this and maybe I'll do (3) the next time we hit this. We do have test coverage and stuff so in theory it shouldn't be tooooo terrible, but it doesn't seem worth it to muck around there if we're only getting a tiny cleanup here.