Page MenuHomePhabricator

Add a "Subscribers" object policy
ClosedPublic

Authored by epriestley on Jun 12 2015, 12:44 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Dec 13, 11:04 PM
Unknown Object (File)
Fri, Dec 13, 12:58 AM
Unknown Object (File)
Thu, Dec 12, 2:36 AM
Unknown Object (File)
Mon, Dec 9, 2:38 PM
Unknown Object (File)
Sun, Dec 8, 8:34 PM
Unknown Object (File)
Nov 19 2024, 3:05 PM
Unknown Object (File)
Nov 15 2024, 9:43 AM
Unknown Object (File)
Nov 15 2024, 1:09 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.