Give regular users a delete button. If they click it, their post will be revised to

say it was deleted.
This commit is contained in:
Robin Ward
2013-02-07 15:12:55 -05:00
parent af11547108
commit 084a873b91
16 changed files with 183 additions and 34 deletions

View File

@ -232,6 +232,15 @@ class Guardian
# Can't delete the first post
return false if post.post_number == 1
# You can delete your own posts
return !post.user_deleted? if post.user == @user
@user.has_trust_level?(:moderator)
end
# Recovery Method
def can_recover_post?(post)
return false if @user.blank?
@user.has_trust_level?(:moderator)
end