@Bean public DelegatingMethodSecurityMetadataSource methodMetadataSource() { ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory( new DefaultMethodSecurityExpressionHandler()); PrePostAnnotationSecurityMetadataSource prePostSource = new PrePostAnnotationSecurityMetadataSource( attributeFactory); return new DelegatingMethodSecurityMetadataSource(Arrays.asList(prePostSource)); }
sources.add(new PrePostAnnotationSecurityMetadataSource(attributeFactory));
private void configureForElAnnotations() { DefaultMethodSecurityExpressionHandler eh = new DefaultMethodSecurityExpressionHandler(); interceptor .setSecurityMetadataSource(new PrePostAnnotationSecurityMetadataSource( new ExpressionBasedAnnotationAttributeFactory(eh))); interceptor.setAccessDecisionManager(adm); AfterInvocationProviderManager aim = new AfterInvocationProviderManager(); aim.setProviders(Arrays.asList(new PostInvocationAdviceProvider( new ExpressionBasedPostInvocationAdvice(eh)))); interceptor.setAfterInvocationManager(aim); } }
@Bean public DelegatingMethodSecurityMetadataSource methodMetadataSource() { ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory( new DefaultMethodSecurityExpressionHandler()); PrePostAnnotationSecurityMetadataSource prePostSource = new PrePostAnnotationSecurityMetadataSource( attributeFactory); return new DelegatingMethodSecurityMetadataSource(Arrays.asList(prePostSource)); }
sources.add(new PrePostAnnotationSecurityMetadataSource(attributeFactory));
@Bean public DelegatingMethodSecurityMetadataSource methodMetadataSource() { ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory( new DefaultMethodSecurityExpressionHandler()); PrePostAnnotationSecurityMetadataSource prePostSource = new PrePostAnnotationSecurityMetadataSource( attributeFactory); return new DelegatingMethodSecurityMetadataSource(Arrays.asList(prePostSource)); }
/** * Provides the default {@link MethodSecurityMetadataSource} that will be * used. It creates a {@link DelegatingMethodSecurityMetadataSource} based * upon {@link #customMethodSecurityMetadataSource()} and the attributes on * {@link EnableGlobalMethodSecurity}. * * @return */ @Bean public MethodSecurityMetadataSource methodSecurityMetadataSource() { List<MethodSecurityMetadataSource> sources = new ArrayList<MethodSecurityMetadataSource>(); ExpressionBasedAnnotationAttributeFactory attributeFactory = new ExpressionBasedAnnotationAttributeFactory( methodExpressionHandler()); MethodSecurityMetadataSource customMethodSecurityMetadataSource = customMethodSecurityMetadataSource(); if (customMethodSecurityMetadataSource != null) { sources.add(customMethodSecurityMetadataSource); } if (prePostEnabled()) { sources.add(new PrePostAnnotationSecurityMetadataSource( attributeFactory)); } if (securedEnabled()) { sources.add(new SecuredAnnotationSecurityMetadataSource()); } if (jsr250Enabled()) { sources.add(new Jsr250MethodSecurityMetadataSource()); } return new DelegatingMethodSecurityMetadataSource(sources); }
sources.add(new PrePostAnnotationSecurityMetadataSource(attributeFactory));
sources.add(new PrePostAnnotationSecurityMetadataSource(attributeFactory));