Add cmtool to Qwaiter

This commit is contained in:
2013-03-03 14:21:29 +01:00
parent ba19316e16
commit a640255927
13 changed files with 115 additions and 69 deletions
@@ -6,6 +6,10 @@ class ApplicationController < ActionController::Base
rescue_from SimplyStored::RecordNotFound, with: :show_404
private
def authorize_cmtool
redirect_to '/', alert: t('general.unauthorized') unless current_user.present? && current_user.admin?
end
def broadcast_user(uid, event, data = {})
message = {channel: "/user/#{uid}", data: {event: event, data: data}}
uri = URI.parse(event_host)