Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F15378883: D17123.id41180.diff
Thu, Mar 13, 5:31 PM
F15365933: D17123.id41186.diff
Tue, Mar 11, 2:13 PM
F15354521: D17123.id41180.diff
Tue, Mar 11, 4:37 AM
F15338902: D17123.diff
Sun, Mar 9, 1:23 PM
F15335467: D17123.id41186.diff
Sat, Mar 8, 3:37 PM
F15334063: D17123.diff
Sat, Mar 8, 6:34 AM
F15332856: D17123.diff
Fri, Mar 7, 9:08 PM
Unknown Object (File)
Fri, Feb 21, 3:00 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