]> _ Git - odl.git/commitdiff
wip #4765
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Oct 2021 12:24:58 +0000 (14:24 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Oct 2021 12:24:58 +0000 (14:24 +0200)
app/Providers/AuthServiceProvider.php

index 0e411ced5bc74f12f23c0f19393b25aa9db805bd..04a0d47a574b92e252729c3c758284871d7fb2dd 100644 (file)
@@ -3,11 +3,9 @@
 namespace App\Providers;
 
 use Cubist\Socialite\CubistSocialiteAuthServiceProvider;
-use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
 use Illuminate\Support\Facades\Gate;
-use Mpyw\NullAuth\NullAuthServiceProvider;
 
-class AuthServiceProvider extends CubistSocialiteAuthServiceProvider
+class AuthServiceProvider extends \Cubist\Backpack\Providers\AuthServiceProvider
 {
     /**
      * The policy mappings for the application.
@@ -26,23 +24,6 @@ class AuthServiceProvider extends CubistSocialiteAuthServiceProvider
     public function boot()
     {
         parent::boot();
-
-        $superadmins = ['vincent.vanwaelscappel@odile.space'];
-        $admins = ['jean-francois.legras@odile.space', 'christelle.perthus@odile.space'];
-        $viewers = [];
-
-        Gate::before(function ($user, $ability) use ($superadmins, $admins, $viewers) {
-            if (in_array($user->email, $superadmins)) {
-                return true;
-            }
-            if (in_array($user->email, $admins)) {
-                return $ability === 'admin' || $ability === 'view';
-            }
-            if (in_array($user->email, $viewers)) {
-                return $ability === 'view';
-            }
-            return null;
-        });
     }
 
 }