discourse/discourse — pull request #2987 by cpradio (2014-11-19 23:42:51+00:00)
Title: FEATURE: Add ?status=deleted querystring

Add ?status=deleted as an advanced querystring argument.

To test this I did the following:
1) Logged the original latest topics query as an Admin, Moderator, user, and anonymous
2) Logged the latest topics query after my changes as an Admin, Moderator, user, and anonymous

Compared the WHERE clauses to verify that all conditions were still being applied.
Added my querystring to verify that it replaced the deleted_at IS NULL condition with deleted_at IS NOT NULL

Oh, and there is a @user.is_staff? check around the deleted_at IS NOT NULL so that regular/anonymous members cannot see deleted topics.