Homec4science

Provide core policy support for Spaces

Authored by epriestley <git@epriestley.com> on Jun 5 2015, 02:46.

Description

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

Details

Committed
epriestley <git@epriestley.com>Jun 5 2015, 02:46
Pushed
aubortJan 31 2017, 17:16
Parents
rPHe595478f1dff: Make policy violation dialog more flexible
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHc1c897b96117: Provide core policy support for Spaces (authored by epriestley <git@epriestley.com>).Jun 5 2015, 02:46