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
F19791661: D13252.id32035.diff
Wed, Feb 25, 11:27 PM
F19773731: D13252.diff
Sat, Feb 21, 10:33 AM
F19707059: D13252.id.diff
Wed, Feb 11, 10:22 AM
F19531116: D13252.diff
Jan 20 2026, 2:34 AM
F19510752: D13252.diff
Jan 11 2026, 2:21 PM
F19371213: D13252.diff
Dec 26 2025, 4:28 PM
F19368397: D13252.diff
Dec 26 2025, 2:38 PM
F19210023: D13252.diff
Dec 17 2025, 12:47 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.