gitlabhq/app/controllers/admin_controller.rb
Robert Speicher 925183ed7a Add an AdminController base class for Admin controllers
Handles stuff that's shared across admin controllers.
2012-09-16 10:06:29 -04:00

12 lines
323 B
Ruby

# Provides a base class for Admin controllers to subclass
#
# Automatically sets the layout and ensures an administrator is logged in
class AdminController < ApplicationController
layout 'admin'
before_filter :authenticate_admin!
def authenticate_admin!
return render_404 unless current_user.is_admin?
end
end