verify before streaming from map channel

This commit is contained in:
Connor Turland 2017-01-03 15:09:20 -05:00
parent 40488b74f2
commit eacd9dae67

View file

@ -2,7 +2,7 @@ class MapChannel < ApplicationCable::Channel
# Called when the consumer has successfully # Called when the consumer has successfully
# become a subscriber of this channel. # become a subscriber of this channel.
def subscribed def subscribed
# TODO: verify permission return unless Pundit.policy(current_user, Map.find(params[:id])).show?
stream_from "map_#{params[:id]}" stream_from "map_#{params[:id]}"
end end
end end