From eacd9dae67f19150877d487e285df82e6a6ec5b2 Mon Sep 17 00:00:00 2001 From: Connor Turland Date: Tue, 3 Jan 2017 15:09:20 -0500 Subject: [PATCH] verify before streaming from map channel --- app/channels/map_channel.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/channels/map_channel.rb b/app/channels/map_channel.rb index deb810b0..e7c10b45 100644 --- a/app/channels/map_channel.rb +++ b/app/channels/map_channel.rb @@ -2,7 +2,7 @@ class MapChannel < ApplicationCable::Channel # Called when the consumer has successfully # become a subscriber of this channel. def subscribed - # TODO: verify permission + return unless Pundit.policy(current_user, Map.find(params[:id])).show? stream_from "map_#{params[:id]}" end -end \ No newline at end of file +end