From b03adf66d8dddf2524a016b4d9e6fba49564d3ca Mon Sep 17 00:00:00 2001 From: jomo Date: Thu, 26 Jun 2014 22:27:30 +0200 Subject: [PATCH] Fix: Accessing threads in deleted forum, will deny access --- app/controllers/forumthreads_controller.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb index 368a5d5..3b27f6d 100644 --- a/app/controllers/forumthreads_controller.rb +++ b/app/controllers/forumthreads_controller.rb @@ -72,12 +72,10 @@ class ForumthreadsController < ApplicationController private def check_permission - if params[:id] - @thread = Forumthread.find(params[:id]) - unless @thread.can_read?(current_user) - flash[:alert] = "You are not allowed to view this thread" - redirect_to forums_path - end + @thread = Forumthread.find(params[:id]) + unless @thread.can_read?(current_user) + flash[:alert] = "You are not allowed to view this thread" + redirect_to forums_path end end