Page MenuHomePhabricator

Allow PolicyRules to serve as "Object Policies"
ClosedPublic

Authored by epriestley on Jun 11 2015, 11:13 PM.
Tags
None
Referenced Files
F13086290: D13257.diff
Thu, Apr 25, 12:09 AM
Unknown Object (File)
Fri, Apr 12, 9:05 PM
Unknown Object (File)
Thu, Apr 11, 8:25 AM
Unknown Object (File)
Fri, Apr 5, 3:00 PM
Unknown Object (File)
Sun, Mar 31, 11:27 PM
Unknown Object (File)
Sat, Mar 30, 2:18 PM
Unknown Object (File)
Thu, Mar 28, 1:34 PM
Unknown Object (File)
Mar 24 2024, 12:27 AM
Subscribers
Tokens
"Mountain of Wealth" token, awarded by joshuaspence."Yellow Medal" token, awarded by btrahan.

Details

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.

Screen Shot 2015-06-11 at 4.07.46 PM.png (465×333 px, 39 KB)

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.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Allow PolicyRules to serve as "Object Policies".
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Jun 11 2015, 11:42 PM
This revision was automatically updated to reflect the committed changes.