Homec4science

Simplify policy filtering for projects and ObjectQuery

Authored by epriestley <git@epriestley.com> on Sep 10 2013, 18:06.

Description

Simplify policy filtering for projects and ObjectQuery

Summary:
Ref T603. Moves to detangle and optimize how we apply policies to filtering objects. Notably:

  • Add a short circuit for omnipotent users.
  • When performing project filtering, do a stricter check for user membership. We don't actually care if the user can see the project or not according to other policy constraints, and checking if they can may be complicated.
  • When performing project filtering, do a local check to see if we're filtering the project itself. This is a common case (a project editable by members of itself, for example) and we can skip queries when it is satisfied.
  • Don't perform policy filtering in ObjectQuery. All the data it aggregates is already filtered correctly.
  • Clean up a little bit of stuff in Feed.

Test Plan: Pages like the Maniphest task list and Project profile pages now issue dramatically fewer queries.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

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

Details

Committed
epriestley <git@epriestley.com>Sep 11 2013, 00:34
Pushed
aubortJan 31 2017, 17:16
Parents
rPH1e42c62b8f5c: Make ManiphestTaskQuery a (mostly) policy-aware query
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPH1f86c7342881: Simplify policy filtering for projects and ObjectQuery (authored by epriestley <git@epriestley.com>).Sep 11 2013, 00:34