Page MenuHomePhabricator

Add a "Subscribers" object policy
ClosedPublic

Authored by epriestley on Jun 12 2015, 12:44 AM.
Tags
None
Referenced Files
F15444005: D13259.id32082.diff
Thu, Mar 27, 7:18 AM
F15441729: D13259.id.diff
Wed, Mar 26, 7:37 PM
F15441570: D13259.id32046.diff
Wed, Mar 26, 6:50 PM
F15438279: D13259.diff
Tue, Mar 25, 11:57 PM
F15431377: D13259.id32082.diff
Mon, Mar 24, 12:00 PM
F15427946: D13259.diff
Sun, Mar 23, 5:18 PM
F15421596: D13259.id32082.diff
Sat, Mar 22, 1:12 AM
F15419191: D13259.diff
Fri, Mar 21, 4:20 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.