Update TelescopeServiceProvider.php

This commit is contained in:
lizandrogd
2025-03-21 21:01:43 -05:00
parent 7fcca03e4e
commit bd26bf284d
+2 -1
View File
@@ -53,7 +53,8 @@ class TelescopeServiceProvider extends TelescopeApplicationServiceProvider
protected function gate(): void
{
Gate::define('viewTelescope', function ($user) {
return $user && in_array($user->rol->nombre, ['administrador', 'super']);
return auth()->check() && (auth()->user()->rol->nombre === "administrador" || auth()->user()->rol->nombre === "super");
});
}
}