X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=routes%2Fchannels.php;h=b0a25526a12701f2f783d06a128c48433c7be02c;hb=HEAD;hp=5d451e1fae88c81c097aa55de6ff039a3cc0a1c3;hpb=4bf2dd1dd1f6d31b2ebe299b7495a8b0e259ec77;p=alttp.git diff --git a/routes/channels.php b/routes/channels.php index 5d451e1..b0a2552 100644 --- a/routes/channels.php +++ b/routes/channels.php @@ -1,5 +1,7 @@ id === (int) $id; + return (int) $user->id === (int) $id; +}); + +Broadcast::channel('App.Control', function ($user) { + return true; +}); + +Broadcast::channel('Channel.{id}', function ($user, $id) { + $channel = Channel::findOrFail($id); + return $user->can('editRestream', $channel); +}); + +Broadcast::channel('Protocol.{id}', function ($user, $id) { + $tournament = Tournament::findOrFail($id); + return $user->can('viewProtocol', $tournament); +}); + +Broadcast::channel('Tournament.{id}', function ($user, $id) { + $tournament = Tournament::findOrFail($id); + return true; });