DamienHarper / auditor

auditor, the missing audit log library
MIT License
164 stars 53 forks source link

Inject the entity in the UserProvider #177

Closed skuhnow closed 1 month ago

skuhnow commented 1 year ago

My Problem: We issue some change requests by a middleware and the user of that middleware is always "internal" so every audit entry has the blame_user "internal", but the actual user is given by the property "updatedBy".

My Suggestion: Inject the $entity in the UserProviderInterface::__invoke() method or, to keep backward compatibility, add a second interface like EntityAwareUserProviderInterface with said signature, so that I can check the entity for the updatedBy property/method and build by User

DamienHarper commented 11 months ago

@skuhnow Sorry for this late reply. I'm not sure to understand your use case and suggestion: where does the updatedBy property come from?