try {
accessDecisionManager = applicationContext.getBean(AccessDecisionManager.class);
} catch (NoSuchBeanDefinitionException ex) {
accessDecisionManager = null;
}
return new Security(authenticationManager, accessDecisionManager, applicationContext);
}