Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require permission in order to view drafts #18

Open
bottiger opened this issue Aug 12, 2011 · 0 comments
Open

Require permission in order to view drafts #18

bottiger opened this issue Aug 12, 2011 · 0 comments

Comments

@bottiger
Copy link

I can see that my previous XSS issue has been more or less ignored, so I don't know why I post this. Anyway, drafts are accessible by everyone which I do not think is what users of the script expect - here's a quick and dirty patch

diff --git a/app/controllers/blog_posts_controller.rb b/app/controllers/blog_posts_controller.rb
index 9b7a55c..7ccfdd6 100644
--- a/app/controllers/blog_posts_controller.rb
+++ b/app/controllers/blog_posts_controller.rb
@@ -32,6 +32,10 @@ class BlogPostsController < ApplicationController

def show
@blog_post = BlogPost.find(params[:id])

  • unless @blog_post.published == 1
  •  require_admin
    
  •  return
    
  • end
    @blog_comment = @blog_post.blog_comments.new
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant