Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Did not blame user (v0.1.22) #109

Open
ziegler-sbw opened this issue Aug 30, 2024 · 0 comments
Open

Did not blame user (v0.1.22) #109

ziegler-sbw opened this issue Aug 30, 2024 · 0 comments

Comments

@ziegler-sbw
Copy link

Symfony: 5.4.41
AuditBundle: 0.1.22

config.yml

data_dog_audit:
    blame_impersonator: true
    audited_entities:
        - ....

If I impersonate a user, the original user is not saved when the change is logged.
I know I am using an older version, but perhaps you have a hint for me on how to work around this issue without having to update your bundle and thereby Symfony.
In the file src/DataDog/AuditBundle/EventSubscriber/AuditSubscriber.php at line 523, the method getRolesNames is called, which returns an array of role names (strings). These roles are iterated over at line 507 and it is checked if the SwitchUserRole is implemented. Since in my version the role ROLE_PREVIOUS_ADMIN is used, the impersonated user is logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant