trabajo-afectivo/app/controllers/application_controller/checks_maintenance.rb

16 lines
447 B
Ruby
Raw Normal View History

# Copyright (C) 2012-2021 Zammad Foundation, http://zammad-foundation.org/
2019-09-05 14:02:31 +00:00
module ApplicationController::ChecksMaintenance
extend ActiveSupport::Concern
private
2019-09-05 14:02:31 +00:00
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