Merge remote-tracking branch 'origin/master'

This commit is contained in:
2021-05-21 12:28:55 +02:00
11 changed files with 4383 additions and 25185 deletions
+4 -1
View File
@@ -25,13 +25,16 @@ class CheckAuth
/** @var User $user */
$user = Auth::user();
// If user is not logged in - Go to login page
if(!isset($user))
return redirect()->route("users.login");
// If the user has the correct permission - Then go to the correct page
if($user->hasAnyPermission($permissions)) {
return $next($request);
}
return redirect()->route("users.login");
// If the user does not have the correct permission - Send them to home page
return redirect()->route("root.index");
}
}