X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/673b58f96f3acfd0281c62a2a7f080825b6fb28b..f3b6e0faa1cbf92b46555bea2fca62ca1895e703:/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