checks_maintenance.rb 448 B

123456789101112131415
  1. # Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. module ApplicationController::ChecksMaintenance
  3. extend ActiveSupport::Concern
  4. private
  5. def in_maintenance_mode?(user)
  6. return false if Setting.get('maintenance_mode') != true
  7. return false if user.permissions?('admin.maintenance')
  8. Rails.logger.info "Maintenance mode enabled, denied login for user #{user.login}, it's no admin user."
  9. true
  10. end
  11. end