From b9355009a65c00d7871e661b097d4bfcb9b0eca8 Mon Sep 17 00:00:00 2001 From: albert Date: Sun, 17 Feb 2013 15:50:42 -0500 Subject: [PATCH] add access check for post previews --- app/presenters/post_presenter.rb | 4 ++++ app/views/forum_topics/show.html.erb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 69e6197e4..1fabde4f2 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -4,6 +4,10 @@ class PostPresenter < Presenter return "" end + unless Danbooru.config.can_user_see_post?(CurrentUser.user, post) + return "" + end + flags = [] flags << "pending" if post.is_pending? flags << "flagged" if post.is_flagged? diff --git a/app/views/forum_topics/show.html.erb b/app/views/forum_topics/show.html.erb index 7a20001cb..17c016284 100644 --- a/app/views/forum_topics/show.html.erb +++ b/app/views/forum_topics/show.html.erb @@ -17,7 +17,7 @@

<%= link_to "Reply »".html_safe, new_forum_post_path(:topic_id => @forum_topic.id) %>

-