From d09009b1fab73549e129ce5c5e071276e5618779 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 28 Nov 2013 20:25:36 +0000 Subject: [PATCH] Allow moderators to reopen hidden notes --- app/controllers/notes_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.43.2