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)
Thu, Apr 11, 9:07 AM
Unknown Object (File)
Mon, Apr 8, 2:14 AM
Unknown Object (File)
Mar 17 2024, 7:43 PM
Unknown Object (File)
Mar 5 2024, 7:42 AM
Unknown Object (File)
Feb 23 2024, 8:05 PM
Unknown Object (File)
Feb 19 2024, 9:11 AM
Unknown Object (File)
Feb 12 2024, 6:58 AM
Unknown Object (File)
Feb 3 2024, 4:53 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.