diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php
index bb6cb31..a851ea5 100644
--- a/app/Providers/AuthServiceProvider.php
+++ b/app/Providers/AuthServiceProvider.php
@@ -27,8 +27,10 @@ class AuthServiceProvider extends ServiceProvider
{
$this->registerPolicies();
- Gate::define('admin',function (User $o) {
- return $o->admin === TRUE;
- });
+ // Mailer Admin
+ Gate::define('admin',fn(User $o)=>($o->admin === TRUE));
+
+ // ZC of a Zone
+ Gate::define('zc',fn(User $o)=>(($o->admin === TRUE) || $o->ZC()));
}
}
diff --git a/resources/views/layouts/partials/sidebar.blade.php b/resources/views/layouts/partials/sidebar.blade.php
index c58933e..74c39fa 100644
--- a/resources/views/layouts/partials/sidebar.blade.php
+++ b/resources/views/layouts/partials/sidebar.blade.php
@@ -2,28 +2,33 @@
FTN Networks
@auth
-
- - My Systems
- @foreach ($user->systems->sortBy('name') as $o)
- - {{ $o->name }}
- @endforeach
-
+ @if($user->systems->count())
+
+ - My Systems
+ @foreach ($user->systems->sortBy('name') as $o)
+ - {{ $o->name }}
+ @endforeach
+
+ @endif
@endauth
-
- - Explore Networks
- @foreach (\App\Models\Domain::select(['id','name'])
- ->when(((! $user) || (! $user->isAdmin())),function($query) { return $query->public()->active(); })
- ->orderBy('name')
- ->get() as $o)
- @if ($o->isManaged())
- - {{ $o->name }}
- @endif
- @endforeach
-
+ @if(($x=\App\Models\Domain::select(['id','name'])
+ ->when(((! $user) || (! $user->isAdmin())),fn($query)=>$query->public()->active())
+ ->orderBy('name')
+ ->get())
+ ->count())
+
+ - Explore Networks
+ @foreach ($x as $o)
+ @if ($o->isManaged())
+ - {{ $o->name }}
+ @endif
+ @endforeach
+
+ @endif
@auth
- @if ($user->isZC())
+ @can('zc')
- Network Admin
- Domains
@@ -32,7 +37,7 @@
- Echoareas
- Fileareas
- @endif
+ @endcan
@can('admin')