maintenance.rb 466 B

12345678910111213141516171819202122
  1. class Sessions::Event::Maintenance < Sessions::Event::Base
  2. def initialize(params)
  3. super(params)
  4. return if !@is_web_socket
  5. ActiveRecord::Base.establish_connection
  6. end
  7. def destroy
  8. return if !@is_web_socket
  9. ActiveRecord::Base.remove_connection
  10. end
  11. def run
  12. # check if sender is admin
  13. return if !permission_check('admin.maintenance', 'maintenance')
  14. Sessions.broadcast(@payload, 'public', @session['id'])
  15. false
  16. end
  17. end