diff --git a/app/DAL/Studies/WorklistFactory.php b/app/DAL/Studies/WorklistFactory.php index c58de3e..394e10a 100644 --- a/app/DAL/Studies/WorklistFactory.php +++ b/app/DAL/Studies/WorklistFactory.php @@ -4,6 +4,7 @@ use App\Models\Enums\UserRole; use Exception; +use Illuminate\Support\Facades\Cache; final readonly class WorklistFactory { @@ -12,7 +13,8 @@ */ public static function getLister(): IUserStudyLister { - $role = auth()->user()->roles()->first()->name; + // $role = auth()->user()->roles()->first()->name; + $role = Cache::remember('user_role:'.auth()->id(), now()->addMinutes(5), fn () => auth()->user()->roles()->first()->name); return match (UserRole::from($role)) { UserRole::Admin => new AdminWorklist,