Page MenuHomePhabricator

Allow different policy rules for different types of objects
ClosedPublic

Authored by epriestley on Jun 11 2015, 7:24 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 23, 12:48 PM
Unknown Object (File)
Wed, Apr 17, 2:52 PM
Unknown Object (File)
Tue, Apr 9, 8:13 PM
Unknown Object (File)
Mon, Apr 1, 4:56 PM
Unknown Object (File)
Mar 17 2024, 7:43 PM
Unknown Object (File)
Mar 6 2024, 3:34 PM
Unknown Object (File)
Mar 6 2024, 3:03 PM
Unknown Object (File)
Feb 9 2024, 2:46 AM
Subscribers
Tokens
"Orange Medal" token, awarded by 20after4.

Details

Summary

Ref T5681. Policy rules can now select objects they can apply to, so a rule like "task author" only shows up where it makes sense (when defining task policies).

This will let us define rules like "members of thread" in Conpherence, "subscribers", etc., to make custom policies more flexible.

Notes:

  • Per D13251, we need to do a little work to get the right options for policies like "Maniphest > Default View Policy". This should allow "task" policies.
  • This implements a "task author" policy as a simple example.
  • The willApplyRule() signature now accepts $objects to support bulk-loading things like subscribers.
Test Plan
  • Defined a task to be "visible to: task author", verified author could see it and other users could not.
  • var_dump()'d willApplyRule() inputs, verified they were correct (exactly the objects which use the rule).
  • Set default view policy to a task-specific policy.
  • Verified that other policies like "Can Use Bulk Editor" don't have these options.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Allow different policy rules for different types of objects.
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, 8:28 PM
This revision was automatically updated to reflect the committed changes.