Roberto Santini 1 mēnesi atpakaļ
vecāks
revīzija
3d53aa0c87

+ 1
- 0
app/Http/Controllers/AcquistoServizioOperatoreController.php Parādīt failu

18
 use Illuminate\Support\Facades\Auth;
18
 use Illuminate\Support\Facades\Auth;
19
 use Illuminate\Support\Facades\Notification;
19
 use Illuminate\Support\Facades\Notification;
20
 use Illuminate\Validation\ValidationException;
20
 use Illuminate\Validation\ValidationException;
21
+use Illuminate\Support\Facades\Storage;
21
 
22
 
22
 class AcquistoServizioOperatoreController extends Controller implements HasMiddleware
23
 class AcquistoServizioOperatoreController extends Controller implements HasMiddleware
23
 {
24
 {

+ 1
- 0
app/Http/Controllers/HomePageController.php Parādīt failu

19
   public static $permission_group = "Home";
19
   public static $permission_group = "Home";
20
   public static $permissions = [
20
   public static $permissions = [
21
     'view-admin_dashboard' => 'Vedi dashboard amministratore',
21
     'view-admin_dashboard' => 'Vedi dashboard amministratore',
22
+    'view-horizon' => 'Accedi a Horizon (code / job)',
22
   ];
23
   ];
23
 
24
 
24
   public function welcome()
25
   public function welcome()

+ 9
- 9
app/Observers/SegnalazioneObserver.php Parādīt failu

59
     }
59
     }
60
 
60
 
61
     if ($segnalazione->wasChanged('stato')) {
61
     if ($segnalazione->wasChanged('stato')) {
62
-      $config = ConfigNotifiche::where('event', ConfigNotifiche::CAMBIO_STATO_REPARTO)->first();
63
-      if ($config && $config->is_attivo && $segnalazione->reparto_id) {
64
-        $email = $fresh->email ?? $fresh->reparto?->email;
65
-        if ($email) {
66
-          Notification::route('mail', $email)->notify(
67
-            new SegnalazioneStatoCambiatoReparto($fresh, $segnalazione->getOriginal('stato'))
68
-          );
69
-        }
70
-      }
62
+      // $config = ConfigNotifiche::where('event', ConfigNotifiche::CAMBIO_STATO_REPARTO)->first();
63
+      // if ($config && $config->is_attivo && $segnalazione->reparto_id) {
64
+      //   $email = $fresh->email ?? $fresh->reparto?->email;
65
+      //   if ($email) {
66
+      //     Notification::route('mail', $email)->notify(
67
+      //       new SegnalazioneStatoCambiatoReparto($fresh, $segnalazione->getOriginal('stato'))
68
+      //     );
69
+      //   }
70
+      // }
71
     }
71
     }
72
   }
72
   }
73
 
73
 

+ 6
- 3
app/Providers/HorizonServiceProvider.php Parādīt failu

28
     protected function gate(): void
28
     protected function gate(): void
29
     {
29
     {
30
         Gate::define('viewHorizon', function ($user = null) {
30
         Gate::define('viewHorizon', function ($user = null) {
31
-            return in_array(optional($user)->email, [
32
-                //
33
-            ]);
31
+            if (! $user) {
32
+                return false;
33
+            }
34
+
35
+            return $user->hasRole('superadmin')
36
+                || $user->can('view-horizon');
34
         });
37
         });
35
     }
38
     }
36
 }
39
 }

+ 1
- 1
config/horizon.php Parādīt failu

70
   |
70
   |
71
   */
71
   */
72
 
72
 
73
-  'middleware' => ['web'],
73
+  'middleware' => ['web', 'auth'],
74
 
74
 
75
   /*
75
   /*
76
   |--------------------------------------------------------------------------
76
   |--------------------------------------------------------------------------

Notiek ielāde…
Atcelt
Saglabāt