mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-10 05:06:46 +10:00
Prevent privilege escalation via "impersonate" feature Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15548 See merge request !1956
12 lines
329 B
Ruby
12 lines
329 B
Ruby
# Provides a base class for Admin controllers to subclass
|
|
#
|
|
# Automatically sets the layout and ensures an administrator is logged in
|
|
class Admin::ApplicationController < ApplicationController
|
|
before_action :authenticate_admin!
|
|
layout 'admin'
|
|
|
|
def authenticate_admin!
|
|
render_404 unless current_user.is_admin?
|
|
end
|
|
end
|