feat: configure Horizon and Pulse access gates for production
This commit is contained in:
@@ -19,6 +19,10 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
|
Gate::define('viewPulse', function (User $user) {
|
||||||
|
return $user->isAdmin();
|
||||||
|
});
|
||||||
|
|
||||||
\Illuminate\Support\Facades\Event::listen(\Illuminate\Auth\Events\Login::class, function (\Illuminate\Auth\Events\Login $event) {
|
\Illuminate\Support\Facades\Event::listen(\Illuminate\Auth\Events\Login::class, function (\Illuminate\Auth\Events\Login $event) {
|
||||||
\App\Models\Mailbox::where('session_id', \Illuminate\Support\Facades\Session::getId())
|
\App\Models\Mailbox::where('session_id', \Illuminate\Support\Facades\Session::getId())
|
||||||
->whereNull('user_id')
|
->whereNull('user_id')
|
||||||
|
|||||||
@@ -28,9 +28,7 @@ class HorizonServiceProvider extends HorizonApplicationServiceProvider
|
|||||||
protected function gate(): void
|
protected function gate(): void
|
||||||
{
|
{
|
||||||
Gate::define('viewHorizon', function ($user = null) {
|
Gate::define('viewHorizon', function ($user = null) {
|
||||||
return in_array(optional($user)->email, [
|
return $user->isAdmin();
|
||||||
//
|
|
||||||
]);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user