restrict edit page access to users allowed to update
This commit is contained in:
@@ -11,6 +11,10 @@ class ForumthreadsController < ApplicationController
|
||||
end
|
||||
|
||||
def edit
|
||||
unless mod? || @thread.author.is?(current_user)
|
||||
flash[:alert] = "You are not allowed to edit this thread!"
|
||||
redirect_to @thread
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
Reference in New Issue
Block a user