summaryrefslogtreecommitdiff
path: root/app/controllers/forumthreads_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/forumthreads_controller.rb')
-rw-r--r--app/controllers/forumthreads_controller.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/forumthreads_controller.rb b/app/controllers/forumthreads_controller.rb
index ac090f5..b9b5714 100644
--- a/app/controllers/forumthreads_controller.rb
+++ b/app/controllers/forumthreads_controller.rb
@@ -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