Introducing permanently delete post functionality

When a post is deleted in Discourse, we perform a soft-delete. This means that post is still present in the database in case an administrator wants to recover it later. A soft-delete is not sufficient when the deleted post contains sensitive information and must be pruned from the database completely. For those situations, we are introducing the ability to permanently delete a post.

This feature was implemented under a hidden site setting because of how dangerous it can be, once a post is destroyed it cannot be recovered. As an additional protection mechanism, posts can be permanently deleted by the same administrator who deleted the post only after 5 minutes have passed OR by a different administrator immediately. If post cannot be deleted because none of the preconditions were met, it will show an error message:

If your site is hosted by us, contact us and we will enable it for you. If you host it yourself, to enable it you must enter the console (rails c) and change the site setting value:

SiteSetting.can_permanently_delete = true