aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/comment_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/comment_controller.rb')
-rw-r--r--app/controllers/comment_controller.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb
index 26c475569..dfa31f9ef 100644
--- a/app/controllers/comment_controller.rb
+++ b/app/controllers/comment_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: comment_controller.rb,v 1.8 2008-11-17 17:08:33 francis Exp $
+# $Id: comment_controller.rb,v 1.9 2009-03-09 01:17:04 francis Exp $
class CommentController < ApplicationController
@@ -22,6 +22,13 @@ class CommentController < ApplicationController
raise "Unknown type " + params[:type]
end
+ # Banned from adding comments?
+ if !authenticated_user.nil? && !authenticated_user.can_make_comments?
+ @details = authenticated_user.can_fail_html
+ render :template => 'user/banned'
+ return
+ end
+
if params[:comment]
# XXX this check should theoretically be a validation rule in the model
@existing_comment = Comment.find_by_existing_comment(@info_request.id, params[:comment][:body])