boolean requiresUser = false;
try
{
RequiresUser annotation = runtimeClass.getAnnotation(RequiresUser.class);
requiresUser = (annotation != null);
}
catch (NullPointerException e)
{
requiresUser = false;
}
if (requiresUser && !(ApplicationSecurity.isRemembered() || ApplicationSecurity.isAuthenticated()))
{
final String message = String.format("Authentication failed for %s on %s", userName, viewName);
logger.warn(message);
throw new AuthenticationException(message);
}
try
{
RequiresUser annotation = method.getAnnotation(RequiresUser.class);
requiresUser = (annotation != null);
}
catch (NullPointerException e)
{
requiresUser = false;