Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge remote-tracking branch 'origin/stable' into pkgr
  • Loading branch information
crohr committed Feb 13, 2018
2 parents 3406a60 + 7174b10 commit c1eb645
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/onebox/engine/discourse_local_onebox.rb
Expand Up @@ -84,12 +84,12 @@ def topic_html(route)

def can_see_post?(post, source_topic)
return false if post.nil? || post.hidden || post.trashed? || post.topic.nil?
Guardian.new.can_see_post?(post) || same_category?(post.topic.category, source_topic)
Guardian.new.can_see_post?(post)
end

def can_see_topic?(topic, source_topic)
return false if topic.nil? || topic.trashed? || topic.private_message?
Guardian.new.can_see_topic?(topic) || same_category?(topic.category, source_topic)
Guardian.new.can_see_topic?(topic)
end

def same_category?(category, source_topic)
Expand Down

0 comments on commit c1eb645

Please sign in to comment.