Skip to content

Did not blame user (v0.1.22) #109

@ziegler-sbw

Description

@ziegler-sbw

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions