X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/673b58f96f3acfd0281c62a2a7f080825b6fb28b..4b4449f7249837c89f2e33109521bf8e29ef8292:/app/controllers/trace_controller.rb diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index a720c5fff..f97e5ecd2 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -33,7 +33,7 @@ class TraceController < ApplicationController @title = if target_user.nil? t "trace.list.public_traces" elsif current_user && current_user == target_user - t "trace.list.your_traces" + t "trace.list.my_traces" else t "trace.list.public_traces_from", :user => target_user.display_name end @@ -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