# Audit information specified in a model … part 2

> Model audit trails in OlivaNova part 2. Implementing audit functionality through model-driven code generation.

*Published October 11, 2010* · Categories: mda, mdsd, olivanova

Source: https://www.kimpel.com/2010/10/11/audit-information-specified-in-a-model-part-2/


In the first part of this post, I wanted to show how easy it is to access information from the currently logged in user and store this information in an action the user executes (who created/changed a record).

Now, what happens, if we have several groups of users (roles)? Well, I could create some IF..ELSE block for each role, but this would probably be not a good idea. A much better approach is to create a base class within the model and inherit all roles from this. So, the model could for instance look like this:

![OlivaNova audit model configuration part 2](https://cdn.kimpel.com/clipboard021.png)

The service to create a new customer will then look like this:

![Generated audit data in application](https://cdn.kimpel.com/clipboard04.png)

So, in order to access information from the currently logged in user, I would refer to the login attribute of the base class named "_RoleBase_" with the keyword "_AGENT_RoleBase.login_". Using a construct like this, I do not have to take care of different roles and the field in the table will always contain the login ID of the user ... whatever role he may refer to.

