-1

Simple case:

There is a user who wants to know when he changed his username. Should I use auditing data to do that?

Are auditing data for admins only?

Marek Raki
  • 3,056
  • 3
  • 27
  • 50
  • I wouldn't mix general usage data with audit data. If it's a common requirement to see the username change, make it a specific feature. If it's not common, tell the user to keep track of his username changes himself. – Kayaman Apr 16 '18 at 11:25
  • @Kayaman Not sure it's actually the best practice, but I've been working with pretty large projects using Envers to keep track of every change, accessible to the app users (via specific screens, of course). What's wrong about it? – HBo Apr 16 '18 at 11:30
  • @HBo well that depends on what you're using it for. If you're using it to provide history data specifically to the users, then sure. If you're storing it for auditing reasons, I wouldn't allow user access. – Kayaman Apr 16 '18 at 11:32
  • @Kayaman Ok you're totally right, thx for the enlightenment – HBo Apr 16 '18 at 11:34
  • @Kayaman I don't believe its as cut-n-dry as your last comment. Envers can be used for both situations and it depends more on the context, more specifically the entity data in question. There are entities or subparts of entities that are useful for users to see historical changes on while other entities it might be more useful for administrators than users. – Naros Apr 23 '18 at 13:28
  • @HBo I'd say use it as you see fit. I've used it to show historical data to both types of users and the views be different as the user in question had differing interests. Perfectly valid scenario!. – Naros Apr 23 '18 at 13:28

1 Answers1

0

You can use Envers to keep track of changes and display it to the user. Whether you use Envers or code the logic is a personal preference.

Revision entities have the same properties as your actual entities, so that may not suit your needs in future.

charlb
  • 1,076
  • 9
  • 18