title: Java SE - storing currently logged in user details
body: <p>Current approach in my Java SE app is to (once authenticated) store <em>only</em> the username as a system property, which I understand may have security implications</p>
  
  <p>Whenever an action is attempted to be performed that requires a certain role, this username is used to make a call to the database to check whether the given user has the role.</p>
  
  <p>I would prefer to load all the roles up front - then to check against some "User" object whether they were permitted for access. All of this needs to be done in a very controlled way, though.</p>
  
  <p>Is there a standard approach / framework for this? Bare in mind I have already authenticated, and just want to store the user's details. <strong>Would storing the currently logged in user as a Singleton be a sensible way to approach this?</strong></p>