diff --git a/app/Policies/NetmailPolicy.php b/app/Policies/NetmailPolicy.php index d4dae03..2745f58 100644 --- a/app/Policies/NetmailPolicy.php +++ b/app/Policies/NetmailPolicy.php @@ -19,17 +19,14 @@ class NetmailPolicy */ public function view(User $user, Netmail $o): bool { - $zones = $user->zc()->pluck('zone') - //->merge($user->rc()->pluck('zone')) - //->merge($user->nc()->pluck('zone')) - //->merge($user->hub()->pluck('zone')) - ->merge($user->points()->pluck('zone')); + $addresses = $user->addresses()->pluck('id'); // Site Admins can always view return ( $user->isAdmin() - || ($zones->contains($o->fftn->zone)) - || ($zones->contains($o->tftn->zone)) + || $user->isZC() + || ($addresses->contains($o->fftn_id)) + || ($addresses->contains($o->tftn_id)) ); } } \ No newline at end of file diff --git a/resources/views/system/widget/system.blade.php b/resources/views/system/widget/system.blade.php index 9834c79..599914b 100644 --- a/resources/views/system/widget/system.blade.php +++ b/resources/views/system/widget/system.blade.php @@ -159,7 +159,7 @@ use App\Models\{Mailer,User};