1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 09:42:41 +01:00
phorge-phorge/src/applications/project
epriestley c4abf160cc Fix some file policy issues and add a "Query Workspace"
Summary:
Ref T603. Several issues here:

  1. Currently, `FileQuery` does not actually respect object attachment edges when doing policy checks. Everything else works fine, but this was missing an `array_keys()`.
  2. Once that's fixed, we hit a bunch of recursion issues. For example, when loading a User we load the profile picture, and then that loads the User, and that loads the profile picture, etc.
  3. Introduce a "Query Workspace", which holds objects we know we've loaded and know we can see but haven't finished filtering and/or attaching data to. This allows subqueries to look up objects instead of querying for them.
    - We can probably generalize this a bit to make a few other queries more efficient. Pholio currently has a similar (but less general) "mock cache". However, it's keyed by ID instead of PHID so it's not easy to reuse this right now.

This is a bit complex for the problem being solved, but I think it's the cleanest approach and I believe the primitive will be useful in the future.

Test Plan: Looked at pastes, macros, mocks and projects as a logged-in and logged-out user.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D7309
2013-10-14 14:36:06 -07:00
..
application Add a 'create' policy to Project 2013-10-10 04:33:18 -07:00
capability Add a 'create' policy to Project 2013-10-10 04:33:18 -07:00
conduit Uninstall Conduit calls when uninstalling applications 2013-03-13 07:09:05 -07:00
constants Use ApplicationSearch in projects 2013-07-22 12:17:52 -07:00
controller Fix some file policy issues and add a "Query Workspace" 2013-10-14 14:36:06 -07:00
editor Remove loadMemberPHIDs from PhabricatorProject 2013-10-06 17:07:08 -07:00
exception Delete license headers from files 2012-11-05 11:16:51 -08:00
lipsum Fixed Project Generation 2013-05-03 08:13:58 -07:00
phid Allow projects to review revisions 2013-10-05 14:10:46 -07:00
query Fix some file policy issues and add a "Query Workspace" 2013-10-14 14:36:06 -07:00
remarkup Make normalization of "#yolo" hashtags less aggressive 2013-09-13 11:48:11 -07:00
search Index projects in the main search index 2013-09-12 13:05:19 -07:00
storage Make PhabricatorPolicyInterface require a getPHID() method 2013-10-14 14:35:47 -07:00