trabajo-afectivo/app/controllers/application_controller/checks_maintenance.rb
2022-01-01 14:38:12 +01:00

15 lines
448 B
Ruby

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