]> git.openstreetmap.org Git - rails.git/blob - app/controllers/old_elements_controller.rb
Add OldElementsController base class
[rails.git] / app / controllers / old_elements_controller.rb
1 class OldElementsController < ApplicationController
2   layout :map_layout
3
4   before_action :authorize_web
5   before_action :set_locale
6   before_action -> { check_database_readable(:need_api => true) }
7   before_action :require_oauth
8
9   authorize_resource
10
11   before_action :require_moderator_for_unredacted_history
12   around_action :web_timeout
13
14   private
15
16   def require_moderator_for_unredacted_history
17     deny_access(nil) if params[:show_redactions] && !current_user&.moderator?
18   end
19 end