From fb7fe2272bf14e5ce5ad73f271f018b8c56cef19 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Tue, 24 Feb 2026 14:22:11 +0700 Subject: [PATCH] fix: correct access check in canAccessPanel method to use instance method instead of auth helper --- app/Models/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Models/User.php b/app/Models/User.php index 813cfd9..47659d0 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -40,6 +40,6 @@ protected function withoutDeveloper(Builder $query): void public function canAccessPanel(Panel $panel): bool { - return auth()->user()->hasRole([RoleEnum::DEVELOPER, RoleEnum::OWNER, RoleEnum::ADMINISTRATOR]); + return $this->hasRole([RoleEnum::DEVELOPER, RoleEnum::OWNER, RoleEnum::ADMINISTRATOR]); } }