maintenance.rb 514 B

1234567891011121314151617181920212223
  1. class Sessions::Event::Maintenance < Sessions::Event::Base
  2. database_connection_required
  3. =begin
  4. Event module to broadcast maintenance messages to all client connections.
  5. To execute this manually, just paste the following into the browser console
  6. App.WebSocket.send({event:'maintenance', data: {some: 'key'}})
  7. =end
  8. def run
  9. # check if sender is admin
  10. return if !permission_check('admin.maintenance', 'maintenance')
  11. Sessions.broadcast(@payload, 'public', @session['id'])
  12. false
  13. end
  14. end