SECURITY: dissalow mods from seeing PMs

This commit is contained in:
Sam
2014-02-07 14:24:19 +11:00
parent 93434be16d
commit d9c05fcfc8
3 changed files with 11 additions and 3 deletions

View File

@@ -100,7 +100,10 @@ module PostGuardain
end
def can_see_post?(post)
post.present? && (is_staff? || (!post.deleted_at.present? && can_see_topic?(post.topic)))
post.present? &&
(is_admin? ||
((is_moderator? || !post.deleted_at.present?) &&
can_see_topic?(post.topic)))
end
def can_see_post_revision?(post_revision)