Page MenuHomePhabricator

Use extended policies in Differential diffs
ClosedPublic

Authored by epriestley on Jan 1 2017, 4:42 PM.
Tags
None
Referenced Files
F13969488: D17123.diff
Oct 17 2024, 2:49 AM
F13965757: D17123.id41186.diff
Oct 16 2024, 4:08 AM
Unknown Object (File)
Sep 10 2024, 2:12 AM
Unknown Object (File)
Sep 3 2024, 12:00 AM
Unknown Object (File)
Sep 3 2024, 12:00 AM
Unknown Object (File)
Sep 3 2024, 12:00 AM
Unknown Object (File)
Sep 2 2024, 9:52 PM
Unknown Object (File)
Aug 26 2024, 8:02 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