]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/notes_controller.rb
Allow a comment to be supplied when hiding a note
[rails.git] / app / controllers / notes_controller.rb
index b7d6631ae87853a41491123637d20b1b1c46f5d9..e79be2e8d31b4605ccaebff60c2a3ca5fa644c42 100644 (file)
@@ -6,6 +6,7 @@ class NotesController < ApplicationController
   before_filter :authorize_web, :only => [:mine]
   before_filter :setup_user_auth, :only => [:create, :comment]
   before_filter :authorize, :only => [:close, :destroy]
+  before_filter :require_moderator, :only => [:destroy]
   before_filter :check_api_writable, :only => [:create, :comment, :close, :destroy]
   before_filter :require_allow_write_notes, :only => [:create, :comment, :close, :destroy]
   before_filter :set_locale, :only => [:mine]
@@ -194,6 +195,7 @@ class NotesController < ApplicationController
 
     # Extract the arguments
     id = params[:id].to_i
+    comment = params[:text]
 
     # Find the note and check it is valid
     note = Note.find(id)
@@ -205,7 +207,7 @@ class NotesController < ApplicationController
       note.status = "hidden"
       note.save
 
-      add_comment(note, nil, "hidden")
+      add_comment(note, comment, "hidden")
     end
 
     # Render the result