X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2acf8cb8f22deb2e2960c99c0eeb8c5d64533c9e..ee4c34172f0a0145344525962cc5411a7f260ff5:/app/controllers/old_ways_controller.rb diff --git a/app/controllers/old_ways_controller.rb b/app/controllers/old_ways_controller.rb index d18121e6f..dd3c3279f 100644 --- a/app/controllers/old_ways_controller.rb +++ b/app/controllers/old_ways_controller.rb @@ -8,6 +8,7 @@ class OldWaysController < ApplicationController authorize_resource + before_action :require_moderator_for_unredacted_history around_action :web_timeout def show @@ -16,4 +17,10 @@ class OldWaysController < ApplicationController rescue ActiveRecord::RecordNotFound render :action => "not_found", :status => :not_found end + + private + + def require_moderator_for_unredacted_history + deny_access(nil) if params[:show_redactions] && !current_user&.moderator? + end end