aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2010-11-23 12:21:40 +1300
committerPhilip Arndt <parndt@gmail.com>2010-11-23 12:21:40 +1300
commit9b7cc770a2b6df6d947af3386fe99b9d1a97d648 (patch)
treeca490701c989244964cd1ed36b63eb18365dc687 /app/controllers
parent97101633ca5f0a94560d18adc0df41ca8f60eed7 (diff)
downloadrefinerycms-blog-9b7cc770a2b6df6d947af3386fe99b9d1a97d648.tar.gz
refinerycms-blog-9b7cc770a2b6df6d947af3386fe99b9d1a97d648.tar.bz2
refinerycms-blog-9b7cc770a2b6df6d947af3386fe99b9d1a97d648.zip
Allow refinery users with access to the blog to see the blog posts when they are draft. Closes GH-19
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/blog/posts_controller.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/controllers/blog/posts_controller.rb b/app/controllers/blog/posts_controller.rb
index 8dd8ada..5de6984 100644
--- a/app/controllers/blog/posts_controller.rb
+++ b/app/controllers/blog/posts_controller.rb
@@ -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