]> git.localhorst.tv Git - alttp.git/blobdiff - app/Policies/ChannelPolicy.php
respond to whispers
[alttp.git] / app / Policies / ChannelPolicy.php
index 03abdff04f6564278e5d1fe2efccf313bc61e8a4..21dc14b1a2174ef3301cfaa856e2b7a7bfd94235 100644 (file)
@@ -30,7 +30,7 @@ class ChannelPolicy
         */
        public function view(User $user, Channel $channel)
        {
-               return $channel->event->visible;
+               return true;
        }
 
        /**
@@ -106,6 +106,20 @@ class ChannelPolicy
                          ->count() > 0;
        }
 
+       /**
+        * Determine whether the user can edit restreams on the channel.
+        *
+        * @param  \App\Models\User  $user
+        * @param  \App\Models\Channel  $channel
+        * @return \Illuminate\Auth\Access\Response|bool
+        */
+       public function editRestream(User $user, Channel $channel) {
+               return $user->channel_crews()
+                         ->where('role', '=', 'admin')
+                         ->where('channel_id', '=', $channel->id)
+                         ->count() > 0;
+       }
+
        /**
         * Determine whether the user can remove episodes from the channel.
         *