1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-13 02:12:41 +01:00
phorge-phorge/webroot/rsrc/css/aphront
epriestley ded641ae32 Add basic per-object privacy policies
Summary:
Provides a basic start for access policies. Objects expose various capabilities, like CAN_VIEW, CAN_EDIT, etc., and set a policy for each capability. We currently implement three policies, PUBLIC (anyone, including logged-out), USERS (any logged-in) and NOONE (nobody). There's also a way to provide automatic capability grants (e.g., the owner of an object can always see it, even if some capability is set to "NOONE"), but I'm not sure how great the implementation feels and it might change.

Most of the code here is providing a primitive for efficient policy-aware list queries. The problem with doing queries naively is that you have to do crazy amounts of filtering, e.g. to show the user page 6, you need to filter at least 600 objects (and likely more) before you can figure out which ones are 500-600 for them. You can't just do "LIMIT 500, 100" because that might have only 50 results, or no results. Instead, the query looks like "WHERE id > last_visible_id", and then we fetch additional pages as necessary to satisfy the request.

The general idea is that we move all data access to Query classes and have them do object filtering. The ID paging primitive allows efficient paging in most cases, and the executeOne() method provides a concise way to do policy checks for edit/view screens.

We'll probably end up with mostly broader policy UIs or configuration-based policies, but there are at least a few cases for per-object privacy (e.g., marking tasks as "Security", and restricting things to the members of projects) so I figured we'd start with a flexible primitive and the simplify it in the UI where we can.

Test Plan: Unit tests, played around in the UI with various policy settings.

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T603

Differential Revision: https://secure.phabricator.com/D2210
2012-04-14 10:13:29 -07:00
..
attached-file-view.css Crop screenshot thumbs in Maniphest 2011-06-01 15:38:17 -07:00
calendar-view.css Build a basic calendar view 2011-08-08 10:34:06 -07:00
context-bar.css Split "Create Another Task" button into "Similar Task" and "Empty Task" 2012-02-08 09:44:22 -08:00
crumbs-view.css Make the Diffusion UI vaguely usable in some cases. 2011-03-12 16:17:34 -08:00
dark-console.css Improve DarkConsole "Services" and "XHProf" plugins 2011-07-11 12:51:58 -07:00
dialog-view.css Add basic per-object privacy policies 2012-04-14 10:13:29 -07:00
error-view.css Make error views look less awful 2012-04-07 17:25:31 -07:00
form-view.css Add a datepicker control 2012-04-04 12:14:10 -07:00
headsup-action-list-view.css Unify Differential/Maniphest/Diffusion styles and allow commits to be flagged explicitly 2012-03-30 14:12:10 -07:00
headsup.css Unify Differential/Maniphest/Diffusion styles and allow commits to be flagged explicitly 2012-03-30 14:12:10 -07:00
list-filter-view.css Allow Maniphest to scale to a massive size 2011-06-28 06:41:05 -07:00
pager-view.css AphrontPagerView and UIExamples. 2011-03-31 17:06:33 -07:00
panel-view.css Refine "Tactical Command" layout and styling 2012-02-27 13:14:32 -08:00
request-failure-view.css PhabricatorEnv 2011-01-31 11:55:26 -08:00
side-nav-view.css Replace home directory list with a dashboard 2012-02-07 16:04:48 -08:00
table-view.css Allow Maniphest queries to be saved 2012-04-10 09:46:04 -07:00
tokenizer.css Some owners read workflows. 2011-04-03 19:20:47 -07:00
tooltip.css Add a basic tooltip UI element 2012-03-12 18:21:02 -07:00
transaction.css Unify Maniphest + Differential comment styles 2012-02-24 13:02:35 -08:00
typeahead.css Use Javelin placeholders and new sorting rules broadly; consolidate tokenizer construction code 2012-03-09 15:46:39 -08:00