9ab43aa762
When the database is in a read-only state, display a banner on each page informing the user they cannot write to that GitLab instance. Closes gitlab-org/gitlab-ce#43937.
11 lines
326 B
Ruby
11 lines
326 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.admin?
|
|
end
|
|
end
|