if(springContext == null || context == null) return true;
Map<String, AbstractSecurityInterceptor> evals = springContext.getBeansOfType(AbstractSecurityInterceptor.class);
Authentication authentication = context.getAuthentication();
FilterInvocation fi = new FilterInvocation(null, "/srv/"+serviceContext.getLanguage()+"/"+serviceName, null);
for(AbstractSecurityInterceptor securityInterceptor: evals.values()) {
if(securityInterceptor == null) return true;
Collection<ConfigAttribute> attrs = securityInterceptor.obtainSecurityMetadataSource().getAttributes(fi);
if (attrs == null) {
continue;
}
if (authentication == null) {
continue;
}
try {
securityInterceptor.getAccessDecisionManager().decide(authentication, fi, attrs);
return true;
} catch (AccessDeniedException unauthorized) {
// ignore
}
}
if (Log.isDebugEnabled(Log.REQUEST)) {
Log.debug(Log.REQUEST, fi.toString() + " denied for " + authentication.toString());
}
return false;
}