X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/9d2f920feb9dce028b985e8d452538d3df7a1d9c..ba543340b177c9a7ca673ad6cbe05e1acfb71a91:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index a720c5fff..ce2494001 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -186,13 +186,13 @@ class TraceController < ApplicationController if !trace.visible? head :not_found - elsif current_user.nil? || trace.user != current_user + elsif current_user.nil? || (trace.user != current_user && !current_user.administrator? && !current_user.moderator?) head :forbidden else trace.visible = false trace.save flash[:notice] = t "trace.delete.scheduled_for_deletion" - redirect_to :action => :list, :display_name => current_user.display_name + redirect_to :action => :list, :display_name => trace.user.display_name end rescue ActiveRecord::RecordNotFound head :not_found