diff --git a/app/Http/Middleware/ConfigureFrontendFromUser.php b/app/Http/Middleware/ConfigureFrontendFromUser.php index 2842944ad..bfd4194fd 100644 --- a/app/Http/Middleware/ConfigureFrontendFromUser.php +++ b/app/Http/Middleware/ConfigureFrontendFromUser.php @@ -6,13 +6,14 @@ use App\Facades\Frontend; use Closure; use Illuminate\Http\Request; +use Illuminate\Support\Facades\Gate; use Symfony\Component\HttpFoundation\Response; class ConfigureFrontendFromUser { public function handle(Request $request, Closure $next): Response { - $frontend = !$request->user()->can_administer + $frontend = Gate::allows('administer') ? FrontendEnum::from($request->user()->frontend) : null;