title: Remove spring security role
body: <p>Is there a way to revoke spring security role? Specifically, I want to remove element from <code>UserDetails.getAuthorities()</code> object</p>
  
  <pre><code>Collection&lt;? extends GrantedAuthority&gt; authorities = userDetails.getAuthorities();
  authorities.remove(new SimpleGrantedAuthority("ROLE_TO_BE_REMOVED"));
  </code></pre>
  
  <p>This code will be successfully compiled, but will throw <code>UnsupportedOperationException</code> when remove is called. The problem is that the standard Authentication implementations ensure that the Collection returned by getAuthorities is non-modifiable (it returns <code>Collections $UnmodifiableRandomAccessList&lt;E&gt;</code>).</p>
  
  <p>So what I need is some other way to remove the role, or a way to bypass Collection immutability.</p>
  
  <p>Spring version used: 3.2.2.RELEASE, Spring security version: 3.1.3.RELEASE</p>