Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F15530545: D17123.id41186.diff
Wed, Apr 23, 5:03 AM
F15520372: D17123.id.diff
Sun, Apr 20, 5:59 AM
F15432062: D17123.id41180.diff
Mar 24 2025, 3:58 PM
F15426685: D17123.id41186.diff
Mar 23 2025, 10:27 AM
F15398433: D17123.diff
Mar 17 2025, 12:05 AM
F15395376: D17123.id.diff
Mar 16 2025, 6:22 AM
F15390765: D17123.diff
Mar 15 2025, 6:34 AM
F15385652: D17123.id.diff
Mar 14 2025, 11:03 PM
Subscribers
None

Details

Summary

Fixes T9648. Diffs currently use return $this->getRevision()->getViewPolicy(); to inherit their revision's view policy.

After the introduction of object policies, this is wrong for policies like "Subscribers", because it means "Subscribers to this object, the diff". Since Diffs have no subscribers, this always fails.

Instead, use extended policies so that the object policy evaluates in the context of the correct object (the revision).

Test Plan
  • Create a revision.
  • Subscribe alice to it.
  • Set view policy to "Subscribers".
  • View revision as alice.
  • Before patch: nonsense fatal about missing diff because of policy error.
  • After patch: alice can see the revision.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable