Page MenuHomePhabricator

Add a "Subscribers" object policy
ClosedPublic

Authored by epriestley on Jun 12 2015, 12:44 AM.
Tags
None
Referenced Files
F19940969: D13259.id.diff
Wed, Apr 15, 6:49 AM
F19933510: D13259.diff
Sat, Apr 11, 3:24 AM
F19924567: D13259.diff
Tue, Apr 7, 7:01 AM
F19924493: D13259.diff
Tue, Apr 7, 6:52 AM
F19862823: D13259.id32082.diff
Mar 14 2026, 10:44 AM
F19815869: D13259.diff
Mar 5 2026, 1:27 AM
F19554290: D13259.diff
Jan 29 2026, 8:05 PM
F19541705: D13259.id32046.diff
Jan 22 2026, 6:42 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.