Added a check for accessibility permission to the project.

This commit is contained in:
Leonid Nikitin 2024-05-18 20:18:41 +05:00
parent b6e1c50486
commit 78e6a1e396
Signed by: kor-elf
GPG Key ID: 3C0F720C170F6E1D

View File

@ -20,6 +20,13 @@ public function handle(Request $request, \Closure $next): Response
\abort(Response::HTTP_NOT_FOUND); \abort(Response::HTTP_NOT_FOUND);
} }
if (
$project->is_public === false
&& ( $request->user() === null || $request->user()->cannot('view', $project) )
) {
\abort(Response::HTTP_FORBIDDEN);
}
return $next($request); return $next($request);
} }
} }