Replace PrivacyEvent dispatch with AuditEvent for viewing a person.

- Updated `PersonController` to dispatch `AuditEvent` with `AUDIT_VIEW` action instead of `PrivacyEvent`.
- Added necessary `AuditEvent` and `AuditTrail` imports to the controller.
This commit is contained in:
2026-01-28 16:20:01 +01:00
parent 59b322ee8e
commit bb96b9312e

View File

@@ -11,6 +11,8 @@ declare(strict_types=1);
namespace Chill\PersonBundle\Controller;
use Chill\MainBundle\Audit\AuditEvent;
use Chill\MainBundle\Entity\AuditTrail;
use Chill\MainBundle\Security\Authorization\AuthorizationHelperInterface;
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
use Chill\PersonBundle\Entity\Household\Household;
@@ -204,8 +206,7 @@ final class PersonController extends AbstractController
'You are not allowed to see this person.'
);
$event = new PrivacyEvent($person);
$this->eventDispatcher->dispatch($event, PrivacyEvent::PERSON_PRIVACY_EVENT);
$this->eventDispatcher->dispatch(new AuditEvent(AuditTrail::AUDIT_VIEW, [$person]));
return $this->render(
'@ChillPerson/Person/view.html.twig',