allow end user to recover a post they delete

automatically delete stubs after 1 day
This commit is contained in:
Sam
2013-07-22 17:48:24 +10:00
parent d68f30c09d
commit 1f3c5cb656
13 changed files with 131 additions and 23 deletions

View File

@ -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)