Skip to content

A self-hosted media server and file management system

fix: demo admin has no access to channels

aminnausin1a7969039bea
diff --git a/routes/channels.php b/routes/channels.php
index b0c0b606..3f9ad5dc 100644
--- a/routes/channels.php
+++ b/routes/channels.php
@@ -1,25 +1,26 @@
<?php
use Illuminate\Support\Facades\Broadcast;
+use Illuminate\Support\Facades\Gate;
-Broadcast::channel('tasks.{id}', function ($user) {
+Broadcast::channel('tasks.{id}', function ($_) {
return true;
});
-Broadcast::channel('tasks.{id}.subtasks', function ($user) {
- return (int) $user->id === 1;
+Broadcast::channel('tasks.{id}.subtasks', function ($_) {
+ return (int) Gate::allows('admin');
});
Broadcast::channel('notifications.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});
-Broadcast::channel('dashboard.tasks', function ($user) {
- return (int) $user->id === 1;
+Broadcast::channel('dashboard.tasks', function ($_) {
+ return (int) Gate::allows('admin');
});
-Broadcast::channel('dashboard.libraries', function ($user) {
- return (int) $user->id === 1;
+Broadcast::channel('dashboard.libraries', function ($_) {
+ return (int) Gate::allows('admin');
});
Broadcast::channel('dashboard', function () {