Use static weaving with spring-security

后端 未结 1 636
孤城傲影
孤城傲影 2021-01-20 22:08

Colleagues, In the spring security documentation I met following notion:

If you want to secure instances which are not created by Spring (using the

1条回答
  •  一生所求
    2021-01-20 22:51

    There is an Aspectj sample in the Spring Security codebase. It compiles against the spring-security-aspects module and then uses:

    
    

    to enable secured annotations. The code is very simple - it is really just a set of JUnit tests. If you take a look, you'll see that these include tests for both Spring-bean instances and instances created using the new operator.

    If you want to know how spring-security-aspects works, check out the aspect source.

    0 讨论(0)
提交回复
热议问题