mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-17 17:01:31 +00:00
Only show version string in health endpoint, when user has permissions
This commit is contained in:
parent
bd686ed9b3
commit
ce267cd69d
1 changed files with 10 additions and 3 deletions
|
|
@ -588,9 +588,16 @@ class UpdateManagerController extends AbstractController
|
||||||
#[Route('/health', name: 'admin_update_manager_health', methods: ['GET'])]
|
#[Route('/health', name: 'admin_update_manager_health', methods: ['GET'])]
|
||||||
public function healthCheck(): JsonResponse
|
public function healthCheck(): JsonResponse
|
||||||
{
|
{
|
||||||
return $this->json([
|
//Only show version if user is logged in and has permission
|
||||||
|
|
||||||
|
$response = [
|
||||||
'status' => 'ok',
|
'status' => 'ok',
|
||||||
'version' => $this->versionManager->getVersion()->toString(),
|
];
|
||||||
]);
|
|
||||||
|
if ($this->isGranted('@system.show_updates')) {
|
||||||
|
$response['version'] = $this->versionManager->getVersion()->toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->json($response);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue