X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/c3498b490b7e695f0be0898e3df76961bda4738e..bde2faac581d7c16582e1012ba036f8c535773f2:/app/controllers/old_nodes_controller.rb?ds=sidebyside diff --git a/app/controllers/old_nodes_controller.rb b/app/controllers/old_nodes_controller.rb index a5b9cf563..9ef2ef881 100644 --- a/app/controllers/old_nodes_controller.rb +++ b/app/controllers/old_nodes_controller.rb @@ -8,6 +8,7 @@ class OldNodesController < ApplicationController authorize_resource + before_action :require_moderator_for_unredacted_history around_action :web_timeout def show @@ -16,4 +17,10 @@ class OldNodesController < 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