Defer looking up the user after creating the audit record
Defer looking up the user after creating the audit record

Adding the command to the audit tables means a COMMIT, which in turn
invalidates any objects loaded before. So if the user is looked up
before adding the audit record, then the query must be re-issued when
the authorization checks access the user object. The solution is to move
the user lookup after the creation of the audit record.

Reviewed-By: Zoltan Sebestyen <be2314d0afde2d2352aeb623a228e572c9b6cb8b@morganstanley.com>

quattor/aquilon,quattor/aquilon,quattor/aquilon,stdweird/aquilon,guillaume-philippon/aquilon,guillaume-philippon/aquilon,stdweird/aquilon,stdweird/aquilon,guillaume-philippon/aquilon