X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/93dab8a1272f8c807da841c0a55b37f74b65b8c3..6559db51dfcdc10187d3e8f845474729dbb9faa6:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index 06db32248..41802a89b 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -3,7 +3,7 @@ class TraceController < ApplicationController layout 'site' def list - @traces = Trace.find(:all) + @traces = Trace.find(:all, :conditions => ['public = true']) end def mine @@ -12,7 +12,11 @@ class TraceController < ApplicationController def view @trace = Trace.find(params[:id]) - render :nothing, :status => 401 if @trace.user.id != @user.id + unless @trace.public + if @user + render :nothing, :status => 401 if @trace.user.id != @user.id + end + end end def create @@ -43,5 +47,4 @@ class TraceController < ApplicationController trace = Trace.find(params[:id]) send_data(trace.icon_picture, :filename => "#{trace.id}.gif", :type => 'image/gif', :disposition => 'inline') if trace.public end - end