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