diff options
author | Louise Crow <louise.crow@gmail.com> | 2012-10-17 14:55:55 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2012-10-17 14:55:55 +0100 |
commit | e6dc0f6606b26e13cb0cd16124fdb2aad3c1b5a6 (patch) | |
tree | c376463aedff99886779eebf1da1ac5eb9da8370 /app/controllers/comment_controller.rb | |
parent | 6f804977c8dc790777af220f821bccb8a04e1be3 (diff) |
Revert "Revert "Merge remote-tracking branch 'henare_github/patch-1'""
This reverts commit 211fe84dc40d97df8aa8724906d9170ed4f78477.
Diffstat (limited to 'app/controllers/comment_controller.rb')
-rw-r--r-- | app/controllers/comment_controller.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 1552017c2..988a8a6f8 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -23,6 +23,13 @@ class CommentController < ApplicationController else raise "Unknown type " + params[:type] end + + # Are comments disabled on this request? + # + # There is no “add comment” link when comments are disabled, so users should + # not usually hit this unless they are explicitly attempting to avoid the comment + # block, so we just raise an exception. + raise "Comments are not allowed on this request" if !@info_request.comments_allowed? # Banned from adding comments? if !authenticated_user.nil? && !authenticated_user.can_make_comments? |