📅  最后修改于: 2022-03-11 15:04:45.735000             🧑  作者: Mango
config.authorize_with do |controller|
if current_user.nil?
redirect_to main_app.new_account_session_path, flash: {error: 'Please Login to Continue..'}
elsif !current_user.admin?
redirect_to main_app.root_path, flash: {error: 'You are not Admin bro!'}
end
end