BUGFIX: history link doesn't work on deleted posts

This commit is contained in:
Régis Hanol
2014-02-04 20:05:50 +01:00
parent 36683ff1e3
commit 4fb274fb9d
7 changed files with 92 additions and 3 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ class Guardian
include CategoryGuardian
include PostGuardain
include TopicGuardian
class AnonymousUser
def blank?; true; end
def admin?; false; end
+3 -1
View File
@@ -104,7 +104,9 @@ module PostGuardain
end
def can_see_post_revision?(post_revision)
post_revision.present? && (is_staff? || can_see_post?(post_revision.post))
return false if post_revision.nil?
return true if SiteSetting.edit_history_visible_to_public
authenticated? && (is_staff? || can_see_post?(post_revision.post))
end
def can_vote?(post, opts={})