add option to show DebugBar only if logged in user is an admin user

This commit is contained in:
2022-08-17 00:20:20 +02:00
committed by Daniel Seifert
parent 6eb4c213b9
commit 75146c8a08
15 changed files with 215 additions and 38 deletions

View File

@ -15,15 +15,21 @@ declare(strict_types=1);
namespace D3\DebugBar\Modules\Core;
use D3\DebugBar\Application\Models\AvailabilityCheck;
use D3\DebugBar\Core\DebugBarExceptionHandler;
use OxidEsales\Eshop\Core\Exception\ExceptionHandler;
class Config_DebugBar extends Config_DebugBar_parent
{
/**
* @return DebugBarExceptionHandler
* @return DebugBarExceptionHandler|ExceptionHandler
*/
protected function getExceptionHandler()
{
return new DebugBarExceptionHandler();
if (AvailabilityCheck::isAvailable()) {
return new DebugBarExceptionHandler();
}
return parent::getExceptionHandler();
}
}