mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 23:36:11 +08:00
allow end user to recover a post they delete
automatically delete stubs after 1 day
This commit is contained in:
@ -267,7 +267,7 @@ class Guardian
|
||||
end
|
||||
|
||||
def can_edit_post?(post)
|
||||
is_staff? || (not(post.topic.archived?) && is_my_own?(post))
|
||||
is_staff? || (!post.topic.archived? && is_my_own?(post) && !post.user_deleted &&!post.deleted_at)
|
||||
end
|
||||
|
||||
def can_edit_user?(user)
|
||||
@ -291,7 +291,7 @@ class Guardian
|
||||
|
||||
# Recovery Method
|
||||
def can_recover_post?(post)
|
||||
is_staff?
|
||||
is_staff? || (is_my_own?(post) && post.user_deleted && !post.deleted_at)
|
||||
end
|
||||
|
||||
def can_recover_topic?(topic)
|
||||
|
Reference in New Issue
Block a user