1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-16 11:52:40 +01:00
phorge-phorge/src/applications/maniphest
epriestley 466755476a Allow PolicyRules to serve as "Object Policies"
Summary:
Ref T5681. Ref T8488. This allows policy rules to provide "Object Policies", which are similar to the global/basic policies:

  - They show up directly in the dropdown (you don't have to create a custom rule).
  - They don't need to create or load anything in the database.

To implement one, you just add a couple methods on an existing PolicyRule that let Phabricator know it can work as an object policy rule.

{F494764}

These rules only show up where they make sense. For example, the "Task Author" rule is only available in Maniphest, and in "Default View Policy" / "Default Edit Policy" of the Application config.

This should make T8488 easier by letting us set the default policies to "Members of Thread", without having to create a dedicated custom policy for every thread.

Test Plan:
  - Set tasks to "Task Author" policy.
  - Tried to view them as other users.
  - Viewed transaction change strings.
  - Viewed policy errors.
  - Set them as default policies.
  - Verified they don't leak into other policy controls.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5681, T8488

Differential Revision: https://secure.phabricator.com/D13257
2015-06-13 15:44:38 -07:00
..
__tests__ Drive Maniphest grouping and ordering through standard infrastructure 2015-06-08 12:23:13 -07:00
application Add a "template" parameter to application default policies 2015-06-11 13:25:30 -07:00
capability Simplify the implementation of PhabricatorPolicyCapability subclasses 2014-07-25 08:25:42 +10:00
command phtize all the things 2015-05-22 21:16:39 +10:00
conduit Drive Maniphest grouping and ordering through standard infrastructure 2015-06-08 12:23:13 -07:00
config Mark some strings for translation 2015-06-09 23:06:52 +10:00
constants Mark some strings for translation 2015-06-09 23:06:52 +10:00
controller Support Spaces in Maniphest batch editor 2015-06-11 10:24:39 -07:00
edge Modernize Pholio edges 2015-01-02 10:11:41 +11:00
editor Drive Maniphest grouping and ordering through standard infrastructure 2015-06-08 12:23:13 -07:00
event Remove implode_selected_handle_links() 2015-03-31 05:48:20 -07:00
export Linter fixes 2015-06-02 22:14:01 +10:00
field Add "and" support to "ref" 2015-05-05 07:14:15 +10:00
lipsum Fix some linter violations 2015-01-03 09:11:41 +11:00
mail phtize all the things 2015-05-22 21:16:39 +10:00
phid Separate handle "status" and "availability" 2015-05-14 11:14:44 -07:00
policyrule Allow PolicyRules to serve as "Object Policies" 2015-06-13 15:44:38 -07:00
query Add a "Date Updated (Oldest First)" sort order to Maniphest 2015-06-10 12:21:12 -07:00
remarkup Rename PhutilRemarkupRule subclasses 2014-08-05 00:55:43 +10:00
search Rename PhabricatorSearchField to PhabricatorSearchFieldDocumentType 2015-06-05 11:01:25 -07:00
storage Support Spaces in ApplicationEmail 2015-06-11 10:23:56 -07:00
typeahead Implement open() and closed() Maniphest tokenizer status functions, plus cleanup 2015-04-23 11:49:34 -07:00
view Support Spaces in Maniphest 2015-06-10 15:53:04 -07:00