mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-29 21:14:29 +02:00
Log AccessDeniedExceptions to event log.
This commit is contained in:
parent
26737f4b46
commit
f116c2f09e
4 changed files with 98 additions and 3 deletions
|
@ -46,6 +46,7 @@ use App\Entity\Attachments\Attachment;
|
|||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Contracts\NamedElementInterface;
|
||||
use App\Entity\LogSystem\AbstractLogEntry;
|
||||
use App\Entity\LogSystem\UserNotAllowedLogEntry;
|
||||
use App\Entity\Parameters\AbstractParameter;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\PriceInformations\Orderdetail;
|
||||
|
@ -86,12 +87,17 @@ class LogEntryTargetColumn extends AbstractColumn
|
|||
{
|
||||
parent::configureOptions($resolver);
|
||||
$resolver->setDefault('show_associated', true);
|
||||
$resolver->setDefault('showAccessDeniedPath', true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function render($value, $context)
|
||||
{
|
||||
if ($context instanceof UserNotAllowedLogEntry && $this->options['showAccessDeniedPath']) {
|
||||
return htmlspecialchars($context->getPath());
|
||||
}
|
||||
|
||||
/** @var AbstractLogEntry $context */
|
||||
$target = $this->entryRepository->getTargetElement($context);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue