# Find the note and check it is valid
@note = Note.find_by_id(id)
raise OSM::APINotFoundError unless @note
# 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?
raise OSM::APIBadUserInput.new("No query string was given") unless params[:q]
# Get any conditions that need to be applied
raise OSM::APIBadUserInput.new("No query string was given") unless params[:q]
# Get any conditions that need to be applied
@notes = @notes.joins(:comments).where("note_comments.body ~ ?", params[:q])
# Find the notes we want to return
@notes = @notes.joins(:comments).where("note_comments.body ~ ?", params[:q])
# Find the notes we want to return
@description = t 'note.mine.subheading', :user => render_to_string(:partial => "user", :object => @this_user)
@page = (params[:page] || 1).to_i
@page_size = 10
@description = t 'note.mine.subheading', :user => render_to_string(:partial => "user", :object => @this_user)
@page = (params[:page] || 1).to_i
@page_size = 10