Homec4science

Fix an issue where file queries would throw incorrectly

Authored by epriestley <git@epriestley.com> on Aug 2 2014, 23:46.

Description

Fix an issue where file queries would throw incorrectly

Summary:
Ref T4589. When you look at a file, we load attached objects in order to run the "you can see this if you can see any attached object" policy check.

However, right now the subquery inherits the "throw on filter" flag from the parent query. This inheritance makes sense in other cases[1], but because this is an "ANY" rule it does not make sense here. In practice, it means that if the file is attached to several objects, and any of them gets filtered, you can not see the file.

Instead, explicitly drop the flag for this subquery.

[1] Sort of. It doesn't produce wrong results in other cases, but now that I think about it might produce a less-tailored error than it could. I'll look into this the next time I'm poking around.

Test Plan:

  • Viewed an "All Users" file attached to a private Mock.
  • Prior to this patch, I incorrectly received an exception when the Mock was loaded. This is wrong; I should be able to see the file because the policy is "All Users".
  • After the patch, I can correctly view the file, just not the associated mock.

{F127074}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: 20after4, aran, epriestley

Maniphest Tasks: T4589

Differential Revision: https://secure.phabricator.com/D8498

Details

Committed
epriestley <git@epriestley.com>Aug 2 2014, 23:46
Pushed
aubortJan 31 2017, 17:16
Parents
rPH9181929ebc2f: Give files uploaded to objects a very restrictive view policy
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHc9fe16247005: Fix an issue where file queries would throw incorrectly (authored by epriestley <git@epriestley.com>).Aug 2 2014, 23:46