From 7b44e0d0af6784e25a01da754a511c409ceb4f4d Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 14 Feb 2022 16:19:27 +0100 Subject: [PATCH] wait #4764 --- app/Http/Middleware/CheckIfAdmin.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/Http/Middleware/CheckIfAdmin.php b/app/Http/Middleware/CheckIfAdmin.php index b7c086b..626b015 100644 --- a/app/Http/Middleware/CheckIfAdmin.php +++ b/app/Http/Middleware/CheckIfAdmin.php @@ -22,8 +22,7 @@ class CheckIfAdmin */ private function checkIfUserIsAdmin($user) { - // return ($user->is_admin == 1); - return true; + return preg_match('/@odile\.space$/', $user->email, $matches); } /** @@ -46,7 +45,7 @@ class CheckIfAdmin * Handle an incoming request. * * @param \Illuminate\Http\Request $request - * @param \Closure $next + * @param \Closure $next * * @return mixed */ @@ -56,7 +55,7 @@ class CheckIfAdmin return $this->respondToUnauthorizedRequest($request); } - if (! $this->checkIfUserIsAdmin(backpack_user())) { + if (!$this->checkIfUserIsAdmin(backpack_user())) { return $this->respondToUnauthorizedRequest($request); } -- 2.39.5