X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/15841e8d2ad12c538ef10f0d0782a25d1d7ff156..57f5b7840e540fd8b2240fe7786e989fb2f829af:/app/controllers/api/traces_controller.rb diff --git a/app/controllers/api/traces_controller.rb b/app/controllers/api/traces_controller.rb index 86f1370f6..8979704a7 100644 --- a/app/controllers/api/traces_controller.rb +++ b/app/controllers/api/traces_controller.rb @@ -16,13 +16,9 @@ module Api around_action :api_call_handle_error def show - trace = Trace.visible.find(params[:id]) + @trace = Trace.visible.find(params[:id]) - if trace.public? || trace.user == current_user - render :xml => trace.to_xml.to_s - else - head :forbidden - end + head :forbidden unless @trace.public? || @trace.user == current_user end def update