mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 22:34:42 +08:00
FEATURE: Whisper posts
This commit is contained in:
@ -144,10 +144,13 @@ module PostGuardian
|
||||
end
|
||||
|
||||
def can_see_post?(post)
|
||||
post.present? &&
|
||||
(is_admin? ||
|
||||
((is_moderator? || !post.deleted_at.present?) &&
|
||||
can_see_topic?(post.topic)))
|
||||
return false if post.blank?
|
||||
return true if is_admin?
|
||||
return false unless can_see_topic?(post.topic)
|
||||
return false unless post.user == @user || post.topic.visible_post_types(@user).include?(post.post_type)
|
||||
return false if !is_moderator? && post.deleted_at.present?
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
def can_view_edit_history?(post)
|
||||
|
Reference in New Issue
Block a user