Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F18833660: D17123.diff
Sun, Oct 26, 5:06 AM
F18803184: D17123.id.diff
Fri, Oct 17, 10:01 PM
F18783289: D17123.diff
Mon, Oct 13, 5:47 AM
F18766325: D17123.id41180.diff
Tue, Oct 7, 4:08 PM
F18756199: D17123.id41186.diff
Sun, Oct 5, 9:59 AM
F18654699: D17123.id.diff
Sep 22 2025, 4:54 PM
F18653878: D17123.id41180.diff
Sep 21 2025, 9:52 PM
F18652199: D17123.id41186.diff
Sep 21 2025, 7:04 AM
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