codemy/writefully

View on GitHub
app/controllers/admin/base_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Admin::BaseController < ApplicationController
  before_action :ensure_admin_user!

  def ensure_admin_user!
    unless current_user and current_user.admin?
      redirect_to root_path, danger: "You don't belong there."
    end
  end
end