diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 5ed2dc55..ff6d311a 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -2,7 +2,7 @@ class AdminController < ApplicationController layout 'admin' before_action :authenticate_user! - before_action :require_admin_access, except: [:masquerade] + before_action :require_admin_access def dashboard end @@ -32,14 +32,15 @@ class AdminController < ApplicationController end def masquerade - # Do not allow masquerading in production, even for admins. - return unless Rails.env.development? - masqueree = User.find_by(id: params[:user_id]) sign_in masqueree redirect_to root_path end + def unsubscribe + + end + private def require_admin_access diff --git a/config/routes.rb b/config/routes.rb index f4fc0232..fbbab0d9 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -166,11 +166,11 @@ Rails.application.routes.draw do scope 'admin_stats' do get '/', to: 'admin#dashboard', as: :admin_dashboard get '/content_type/:type', to: 'admin#content_type', as: :admin_content_type - get '/attributes', to: 'admin#attributes', as: :admin_attributes get '/masquerade/:user_id', to: 'admin#masquerade', as: :masquerade end mount RailsAdmin::Engine => '/admin', as: 'rails_admin' + get '/admin/unsubscribe', to: 'admin#unsubscribe' scope 'export' do get '/', to: 'export#index', as: :notebook_export