Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F13082188: D17123.diff
Wed, Apr 24, 10:02 PM
Unknown Object (File)
Sun, Apr 21, 4:08 PM
Unknown Object (File)
Wed, Apr 17, 3:10 PM
Unknown Object (File)
Thu, Apr 11, 7:19 AM
Unknown Object (File)
Thu, Apr 4, 1:23 AM
Unknown Object (File)
Thu, Apr 4, 12:08 AM
Unknown Object (File)
Wed, Apr 3, 8:19 PM
Unknown Object (File)
Wed, Apr 3, 7:14 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
Branch
parse3
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15068
Build 19775: Run Core Tests
Build 19774: arc lint + arc unit