title: Grails : Spring Security Core - how to sort by account/user with default configuration
body: <p>I am currently working through an issue of sorting using Spring Security Core. I am list users by role and with the recommended setup will require a lot more code. What would be the best route to sort on Account/User attributes using Spring Security Core/Shiro?</p>
  
  <p>This is how I am currently populating a list and count.</p>
  
  <pre><code>def accountRoles = AccountRole.findAllByRole(role, [max: max, offset: offset])
  def accountInstanceTotal = AccountRole.countByRole(role)
  def accountInstanceList = accountRoles.collect(){ it.account }
  </code></pre>
  
  <p><strong>Account</strong></p>
  
  <pre><code>Set&lt;Role&gt; getAuthorities() {
      AccountRole.findAllByAccount(this)*.role
  }
  </code></pre>
  
  <p>Default configuration doesn't have a hasMany relationship to lookup by role on Account/User.</p>
  
  <p>Any guidance would be most appreciated. Thanks in advance for your help.</p>