Fix: Accessing threads in deleted forum, will deny access

This commit is contained in:
jomo
2014-06-26 22:27:30 +02:00
parent 0ea9bd2e33
commit b03adf66d8

View File

@@ -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