Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F19824643: D17123.id41186.diff
Sun, Mar 8, 1:52 AM
F19800934: D17123.diff
Sat, Feb 28, 7:39 PM
F19733601: D17123.id41180.diff
Sat, Feb 14, 10:19 PM
F19697587: D17123.id41180.diff
Tue, Feb 10, 4:39 PM
F19658549: D17123.id41180.diff
Feb 6 2026, 11:32 PM
F19609746: D17123.diff
Feb 3 2026, 2:05 PM
F19549011: D17123.diff
Jan 27 2026, 2:01 AM
F19464032: D17123.diff
Jan 3 2026, 12:16 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