X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/17e6e69c39072d8e6cb316b75b311e89c92cca45..e731dd71a77ad4ad1e9db22535e89444bb98e5d9:/app/controllers/api/traces_controller.rb diff --git a/app/controllers/api/traces_controller.rb b/app/controllers/api/traces_controller.rb index fd43a1d44..8979704a7 100644 --- a/app/controllers/api/traces_controller.rb +++ b/app/controllers/api/traces_controller.rb @@ -16,14 +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 - @traces = [trace] - render "trace" - else - head :forbidden - end + head :forbidden unless @trace.public? || @trace.user == current_user end def update