Principal principal = new SerializablePrincipal(userName);
if (handlerChainConfig.getParameter(GeneralConstants.ROLE_VALIDATOR_IGNORE) == null) {
// Validate the roles
IRoleValidator roleValidator = (IRoleValidator) handlerChainConfig
.getParameter(GeneralConstants.ROLE_VALIDATOR);
if (roleValidator == null)
throw logger.nullValueError("Role Validator");
boolean validRole = roleValidator.userInRole(principal, roles);
if (!validRole) {
logger.trace("Invalid role: " + roles);
principal = null;
}