1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-28 17:52:43 +01:00
phorge-phorge/src/applications/project/query
epriestley 40d3bcb891 Fix a complicated object caching issue with the policy filter
Summary:
Fixes T11853. To set this up:

  - Create "Project A".
  - Join "Project A".
  - Create a subproject, "Project A Subproject 1".
    - This causes Project A to become a parent project.
    - This moves you to be a member of "Project A Subproject 1" instead of "Project A" directly.
  - Create another subproject, "Project A Subproject 2".
    - Do not join this subproject.
  - Set the second subproject's policy to "Visible To: Members of Project A".
  - Try to edit the second subproject.

Before this change, this fails:

  - When querying projects, we sometime try to skip loading the viewer's membership in ancestor projects as a small optimization.
  - Via `PhabricatorExtendedPolicyInterface`, we may then return the parent project to the policy filter for extended checks.
  - The PolicyFilter has an optimization: if we're checking an object, and we already have that object, we can just use the object we already have. This is common and useful.
  - However, in this case it causes us to reuse an incomplete object (an object without proper membership information). We fail a policy check which we should pass.

Instead, don't skip loading the viewer's membership in ancestor projects.

Test Plan:
  - Did all that stuff above.
  - Could edit the subproject.
  - Ran `arc unit --everything`.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11853

Differential Revision: https://secure.phabricator.com/D16840
2016-11-11 13:42:18 -08:00
..
PhabricatorProjectColumnPositionQuery.php Remove old position-on-read board column code 2016-02-03 15:07:24 -08:00
PhabricatorProjectColumnQuery.php Roughly implement milestone columns on workboards 2016-02-03 16:37:59 -08:00
PhabricatorProjectColumnTransactionQuery.php Workboards - add column detail page 2014-03-26 14:40:47 -07:00
PhabricatorProjectQuery.php Fix a complicated object caching issue with the policy filter 2016-11-11 13:42:18 -08:00
PhabricatorProjectSearchEngine.php Allow users to seach for projects by watcher 2016-02-17 11:47:55 -08:00
PhabricatorProjectTransactionQuery.php Add project history and title strings 2013-10-22 13:49:37 -07:00