mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
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:
parent
af11547108
commit
084a873b91
16 changed files with 183 additions and 34 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue