Skip to content

Commit 4a4412b

Browse files
committed
enable admin access in development mode
1 parent 73f72f4 commit 4a4412b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/controllers/admin_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class AdminController < ApplicationController
33
layout 'application', only: [:unsubscribe, :perform_unsubscribe]
44

55
before_action :authenticate_user!
6-
before_action :require_admin_access
6+
before_action :require_admin_access, unless: -> { Rails.env.development? }
77

88
def dashboard
99
@reports = EndOfDayAnalyticsReport.order('day DESC').limit(90)

config/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@
242242
end
243243
get 'search/', to: 'search#results'
244244

245-
authenticate :user, lambda { |u| u.site_administrator? } do
245+
authenticate :user, lambda { |u| u.site_administrator? || Rails.env.development? } do
246246
scope 'admin' do
247247
get '/stats', to: 'admin#dashboard', as: :admin_dashboard
248248
get '/content_type/:type', to: 'admin#content_type', as: :admin_content_type

0 commit comments

Comments
 (0)