We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 56ff5a8 commit 8d1067fCopy full SHA for 8d1067f
lib/ret_web/channels/hub_channel.ex
@@ -297,7 +297,11 @@ defmodule RetWeb.HubChannel do
297
account = Guardian.Phoenix.Socket.current_resource(socket)
298
hub = socket |> hub_for_socket
299
300
- if (type != "photo" and type != "video") or account |> can?(spawn_camera(hub)) do
+ if (type == "photo" and type == "video" and !account |> can?(spawn_camera(hub))) or
301
+ (type == "permission" and !Ret.Hub.is_owner?(account.account_id)) do
302
+ {:noreply, socket}
303
+ end
304
+
305
broadcast!(
306
socket,
307
event,
@@ -306,7 +310,6 @@ defmodule RetWeb.HubChannel do
310
|> Map.put(:session_id, socket.assigns.session_id)
311
|> payload_with_from(socket)
308
312
)
309
- end
313
314
{:noreply, socket}
315
end
0 commit comments