是否可以使用切入点保护我的@Controller类?我尝试过:Spring Security/AspectJ切入点
<global-method-security pre-post-annotations="enabled">
<!-- Block anything ending with the word 'Controller'-->
<protect-pointcut expression="execution(* my.pkg.*Controller.*(..))" access="NON_EXISTANT_ROLE"/>
</global-method-security>
从理论上讲,我永远无法击中控制器,因为任何用户都不存在该角色。但是,控制器运行良好。
您使用的是哪种版本的弹簧安全? – Ritesh
我使用的是3.0.7版本 – user973479
我在3.0.5之前有过这个问题。还要确保在控制器上下文中存在全局方法安全性。 – Ritesh