Page MenuHomePhabricator

Locations Scenario: Destroying Locations
Closed, ResolvedPublic

Description

Normally, Phabricator does not allow users to permanently destroy data from the web interface. (One reason for this is that it reduces the amount of damage an attacker who gains control of an account can do.)

However, it's still sometimes necessary to destroy objects, so we provide bin/remove destroy command for users with CLI access that works like this:

phabricator/ $ ./bin/remove destroy <object>

To support destroying locations:

  • Implement PhabricatorDestructibleInterface on LocationsLocation. You can follow ManiphestTask as an example.
  • Test destroying objects by running bin/remove destroy <phid>. Include this output in your test plan, and verify the object has been removed from the web interface.

You can find the PHID for a location by doing any of these things:

  • Look in the database table with mysql.
  • Implement an API method first (T12006), then use the API to look up the PHID.
  • Edit the code to var_dump(), echo, print, or phlog() the PHID, or put the PHID into the UI.
  • Guess your favorite PHIDs.
  • If you've already implemented monograms, you can use a monogram instead of a PHID.