Allow refinery users with access to the blog to see the blog posts when they are draft. Closes GH-19

This commit is contained in:
Philip Arndt 2010-11-23 12:21:40 +13:00
parent 97101633ca
commit 9b7cc770a2
2 changed files with 8 additions and 1 deletions

View file

@ -73,7 +73,13 @@ class Blog::PostsController < BlogController
protected
def find_blog_post
@blog_post = BlogPost.live.find(params[:id])
unless (@blog_post = BlogPost.find(params[:id])).try(:live?)
if refinery_user? and current_user.authorized_plugins.include?("refinerycms_blog")
@blog_post = BlogPost.find(params[:id])
else
error_404
end
end
end
def find_all_blog_posts