From: Tom Hughes Date: Thu, 28 Nov 2013 20:25:36 +0000 (+0000) Subject: Allow moderators to reopen hidden notes X-Git-Tag: live~4658 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d09009b1fab73549e129ce5c5e071276e5618779 Allow moderators to reopen hidden notes --- diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index a297748bd..333597a72 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -155,8 +155,8 @@ class NotesController < ApplicationController # Find the note and check it is valid @note = Note.find_by_id(id) raise OSM::APINotFoundError unless @note - raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible? - raise OSM::APINoteAlreadyOpenError.new(@note) unless @note.closed? + raise OSM::APIAlreadyDeletedError.new("note", @note.id) unless @note.visible? or @user.moderator? + raise OSM::APINoteAlreadyOpenError.new(@note) unless @note.closed? or not @note.visible? # Reopen the note and add a comment Note.transaction do