]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/browse_controller.rb
Hide hidden notes and comments correctly in the data browser
[rails.git] / app / controllers / browse_controller.rb
index c7f8b0e819849e66b4df3b554a6eee37d7a093a8..0ac45b9261d1a4dcc1a1d6135747ca6489fd5f40 100644 (file)
@@ -76,7 +76,14 @@ class BrowseController < ApplicationController
 
   def note
     @type = "note"
-    @note = Note.find(params[:id])
+
+    if @user && @user.moderator?
+      @note = Note.find(params[:id])
+      @note_comments = @note.comments.unscope(:where => :visible)
+    else
+      @note = Note.visible.find(params[:id])
+      @note_comments = @note.comments
+    end
   rescue ActiveRecord::RecordNotFound
     render :action => "not_found", :status => :not_found
   end