From e6dc0f6606b26e13cb0cd16124fdb2aad3c1b5a6 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 17 Oct 2012 14:55:55 +0100 Subject: Revert "Revert "Merge remote-tracking branch 'henare_github/patch-1'"" This reverts commit 211fe84dc40d97df8aa8724906d9170ed4f78477. --- app/controllers/comment_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/controllers/comment_controller.rb') 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? -- cgit v1.2.3