diff options
| author | Robert Speicher <rspeicher@gmail.com> | 2012-09-16 07:44:54 -0400 |
|---|---|---|
| committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-16 10:06:29 -0400 |
| commit | 925183ed7a8eb392e008764483f59c319e22a59c (patch) | |
| tree | 8b83b70d76864103fddb997adb149dae7cf5c796 /app/controllers/admin_controller.rb | |
| parent | 83f24de3520ba1c49544b268253a0665831c2bd5 (diff) | |
| download | gitlab-ce-925183ed7a8eb392e008764483f59c319e22a59c.tar.gz | |
Add an AdminController base class for Admin controllers
Handles stuff that's shared across admin controllers.
Diffstat (limited to 'app/controllers/admin_controller.rb')
| -rw-r--r-- | app/controllers/admin_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb new file mode 100644 index 00000000000..bce9f692385 --- /dev/null +++ b/app/controllers/admin_controller.rb @@ -0,0 +1,11 @@ +# 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 |
