1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-11 01:12:41 +01:00
phorge-phorge/src/infrastructure
epriestley c1c897b961 Provide core policy support for Spaces
Summary:
Ref T8424. No UI or interesting behavior yet, but integrates Spaces checks:

  - `PolicyFilter` now checks Spaces.
  - `PolicyAwareQuery` now automatically adds Spaces constraints.

There's one interesting design decision here: **spaces are stronger than automatic capabilities**. That means that you can't see a task in a space you don't have permission to access, //even if you are the owner//.

I //think// this is desirable. Particularly, we need to do this in order to exclude objects at the query level, which potentially makes policy filtering for spaces hugely more efficient. I also like Spaces being very strong, conceptually.

It's possible that we might want to change this; this would reduce our access to optimizations but might be a little friendlier or make more sense to users later on.

For now, at least, I'm pursuing the more aggressive line. If we stick with this, we probably need to make some additional UI affordances (e.g., show when an owner can't see a task).

This also means that you get a hard 404 instead of a policy exception when you try to access something in a space you can't see. I'd slightly prefer to show you a policy exception instead, but think this is generally a reasonable tradeoff to get the high-performance filtering at the Query layer.

Test Plan:
  - Added and executed unit tests.
  - Put objects in spaces and viewed them with multiple users.
  - Made the default space visible/invisible, viewed objects.
  - Checked the services panel and saw `spacePHID` constraints.
  - Verified that this adds only one query to each page.

Reviewers: btrahan, chad

Reviewed By: btrahan

Subscribers: chad, epriestley

Maniphest Tasks: T8424

Differential Revision: https://secure.phabricator.com/D13156
2015-06-04 17:46:32 -07:00
..
customfield Improve UX for Diffusion mail fields 2015-05-25 07:18:48 -07:00
daemon Introduce a request cache mechanism 2015-06-04 17:27:31 -07:00
diff Increase CSS specificity on Inline Comment Summary 2015-05-31 08:37:18 -07:00
edges phtize all the things 2015-05-22 21:16:39 +10:00
env Send mail to targets in the user's translation 2015-06-03 18:59:33 -07:00
events phtize all the things 2015-05-22 21:16:39 +10:00
internationalization Send mail to targets in the user's translation 2015-06-03 18:59:33 -07:00
javelin Allow Javelin initBehavior to source alternative library behaviors 2014-11-04 06:47:07 -08:00
lint/linter phtize all the things 2015-05-22 21:16:39 +10:00
log Explicitly declare method/property visibility 2015-01-12 08:18:13 +11:00
management Add some of a billing daemon skeleton 2015-01-30 11:29:05 -08:00
markup phtize all the things 2015-05-22 21:16:39 +10:00
query Provide core policy support for Spaces 2015-06-04 17:46:32 -07:00
sms phtize all the things 2015-05-22 21:16:39 +10:00
ssh phtize all the things 2015-05-22 21:16:39 +10:00
storage Add spacePHID infrastructure and implement in Paste 2015-06-04 17:45:24 -07:00
testing phtize all the things 2015-05-22 21:16:39 +10:00
time Multi-day events should be correctly calculated for new js layout 2015-05-25 11:19:57 -07:00
util phtize all the things 2015-05-22 21:16:39 +10:00
PhabricatorEditor.php Use ManiphestTaskQuery in nearly all interfaces 2013-09-25 13:44:14 -07:00