Page MenuHomePhabricator

Add a "Subscribers" object policy
ClosedPublic

Authored by epriestley on Jun 12 2015, 12:44 AM.
Tags
None
Referenced Files
F18051776: D13259.id32046.diff
Mon, Aug 4, 12:26 AM
F18048646: D13259.id.diff
Sun, Aug 3, 1:41 PM
F17915179: D13259.id.diff
Tue, Jul 29, 8:16 PM
F17892318: D13259.diff
Tue, Jul 29, 4:34 AM
F17882157: D13259.diff
Mon, Jul 28, 10:33 PM
F17801580: D13259.id32046.diff
Fri, Jul 25, 7:58 AM
F17752306: D13259.diff
Tue, Jul 22, 6:51 AM
F17752170: D13259.diff
Tue, Jul 22, 6:37 AM
Subscribers

Details

Summary

Ref T5681. Getting this to work correctly is a bit tricky, mostly because of the policy checks we do prior to applying an edit.

I think I came up with a mostly-reasonable approach, although it's a little bit gross. It uses spl_object_hash() so it shouldn't be able to do anything bad/dangerous (the hints are strictly bound to the hinted object, which is a clone that we destroy moments later).

Test Plan
  • Added + ran a unit test.
  • Created a task with a "Subscribers" policy with me as a subscriber (without the hint stuff, this isn't possible: since you aren't a subscriber *yet*, you get a "you won't be able to see it" error).
  • Unsubscribed from a task with a "Subscribers" policy, was immediately unable to see it.
  • Created a task with a "subscribers" policy and a project subscriber with/without me as a member (error / success, respectively).

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Add a "Subscribers" object policy.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: btrahan.
btrahan edited edge metadata.
This revision is now accepted and ready to land.Jun 12 2015, 2:28 PM
src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
2108

Test - Ignore

This revision was automatically updated to reflect the committed changes.