title: Acegi Security: How do i add another GrantedAuthority to Authentication to anonymous user
body: <p>i give users special URL with access key in it. users accessing the public page via this special url should be able to see some additional data as compared to simple anonymous user. </p>
  
  <p>i want to give some additional role to anonymous user based on parameters provided in request so i can do something like this in my template:</p>
  
  <pre><code>&lt;@sec.authorize ifAnyGranted="ROLE_ADMIN, ROLE_USER, ROLE_INVITED_VISITOR"&gt;
  ...some additional stuff for invited user to see
  &lt;/@sec.authorize&gt;
  </code></pre>
  
  <p>currently i'm implementing Spring's <code>OncePerRequestfilter</code>:</p>
  
  <pre class="lang-java prettyprint-override"><code>protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws ServletException, IOException {
      if (null != request.getParameter("accessKey")) {
          if(isValid(request.getParameter("accessKey"))) {
              Authentication auth = SecurityContextHolder.getContext().getAuthentication();
              //how do i add additional roles to authenticated (potentially anonymous) user?
          }
      }
  }
  </code></pre>