aspectj-context.xml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:sec="http://www.springframework.org/schema/security"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd">
  7. <sec:global-method-security secured-annotations="enabled" mode="aspectj" />
  8. <!--
  9. <bean id="aspectJSecurityInterceptor"
  10. class="org.springframework.security.access.intercept.aspectj.AspectJMethodSecurityInterceptor">
  11. <property name="authenticationManager" ref="authenticationManager" />
  12. <property name="accessDecisionManager" ref="accessDecisionManager" />
  13. <property name="securityMetadataSource">
  14. <bean
  15. class="org.springframework.security.access.annotation.SecuredAnnotationSecurityMetadataSource" />
  16. </property>
  17. </bean>
  18. <bean id="authenticationManager"
  19. class="org.springframework.security.authentication.ProviderManager">
  20. <property name="providers">
  21. <bean
  22. class="org.springframework.security.authentication.TestingAuthenticationProvider" />
  23. </property>
  24. </bean>
  25. <bean id="accessDecisionManager"
  26. class="org.springframework.security.access.vote.AffirmativeBased">
  27. <property name="decisionVoters">
  28. <list>
  29. <bean
  30. class="org.springframework.security.access.vote.RoleVoter" />
  31. </list>
  32. </property>
  33. </bean>
  34. <bean
  35. class="org.springframework.security.access.intercept.aspectj.aspect.AnnotationSecurityAspect"
  36. factory-method="aspectOf">
  37. <property name="securityInterceptor" ref="aspectJSecurityInterceptor" />
  38. </bean>
  39. -->
  40. <bean class="sample.aspectj.Service" />
  41. <bean class="sample.aspectj.SecuredService" />
  42. </beans>