Explorar el Código

add canManageByUser

visuddhinanda hace 1 año
padre
commit
384c166127
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5 1
      app/Http/Api/ChannelApi.php

+ 5 - 1
app/Http/Api/ChannelApi.php

@@ -83,7 +83,11 @@ class ChannelApi{
         }
         return $output;
     }
-
+    public static function canManageByUser($channelId,$userUuid){
+        $isOwner = Channel::where('owner_uid', $userUuid)
+                    ->where('uid', $channelId)->exists();
+        return $isOwner;
+    }
     public static function getSysChannel($channel_name,$fallback=""){
         $channel = Channel::where('name',$channel_name)
                     ->where('owner_uid',config("mint.admin.root_uuid"))