]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/old_relations_controller.rb
Bump qs from 6.11.2 to 6.12.0
[rails.git] / app / controllers / old_relations_controller.rb
index 9dda82021e21c46afe81db153d93fe51478ee201..b9e151a4fd8b9cc702bf753bc700efcb60528afc 100644 (file)
@@ -8,6 +8,7 @@ class OldRelationsController < ApplicationController
 
   authorize_resource
 
 
   authorize_resource
 
+  before_action :require_moderator_for_unredacted_history
   around_action :web_timeout
 
   def show
   around_action :web_timeout
 
   def show
@@ -16,4 +17,10 @@ class OldRelationsController < ApplicationController
   rescue ActiveRecord::RecordNotFound
     render :action => "not_found", :status => :not_found
   end
   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
 end