pentaho/pentaho-platform — pull request #334 by pedrofvteixeira (2013-04-11 17:23:05+00:00)
Title: BISERVER-6875 SecurityHelper.runAsUnauthenticated should run with a non-null Authentication instance: AnonymousAuthenticationToken

Action-based security needs a non-null Authentication.
So instead of doing SecurityContextHolder.clearContext() which nulls out the Authentication, do SecurityContextHolder.getContext().setAuthentication(AnonymousAuthenticationToken).
This is harder than it needs to be because of the lack of availability of THE anonymous user and role names from the Spring application context.

Also, rename the method to runAsAnonymous.