boolean requiresGuest = false;
try
{
RequiresGuest annotation = runtimeClass.getAnnotation(RequiresGuest.class);
requiresGuest = (annotation != null);
}
catch (NullPointerException e)
{
requiresGuest = false;
}
if (requiresGuest && !ApplicationSecurity.isGuest())
{
final String message = String.format("Guest role is required for %s on %s", userName, viewName);
logger.warn(message);
throw new AuthenticationException(message);
}
try
{
RequiresGuest annotation = method.getAnnotation(RequiresGuest.class);
requiresGuest = (annotation != null);
}
catch (NullPointerException e)
{
requiresGuest = false;