From 9350fb4b9713def74947d392e966542aaf2af92b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 8 Feb 2024 13:54:16 +0100 Subject: [PATCH] Fix access control in Admin Index and hide Admin link in navbar --- app/Livewire/Admin/Index.php | 2 +- resources/views/components/navbar.blade.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Livewire/Admin/Index.php b/app/Livewire/Admin/Index.php index 1908fe107..75b3f1d22 100644 --- a/app/Livewire/Admin/Index.php +++ b/app/Livewire/Admin/Index.php @@ -11,7 +11,7 @@ class Index extends Component public $users = []; public function mount() { - if (!isInstanceAdmin()) { + if (auth()->user()->id !== 0) { return redirect()->route('dashboard'); } $this->users = User::whereHas('teams', function ($query) { diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index 04ce6257f..5d7eae25b 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -142,7 +142,7 @@ - @if (isCloud() && isInstanceAdmin()) + {{-- @if (isCloud() && isInstanceAdmin())
  • @@ -151,7 +151,7 @@
  • - @endif + @endif --}}
    @if (isInstanceAdmin() && !isCloud()) @persist('upgrade')