0
我想使用弹簧安全的spring bean来确定是否应该显示一个页面。下面是我希望做什么psudocode例如:春季安全使用Bean访问配置属性
<security:http use-expressions="true">
<security:intercept-url pattern="/devlogin.html" access="someBean.isNotProduction()" />
</security:http>
我知道的是,上述不工作,但希望它起到的是我正在寻找一个例子。我不想只告诉Spring“允许访问这样和那样的角色”,而是“如果你在测试系统上运行,允许访问”。我运气好还有一些这样的解决方案存在,还是这不是我所期望的Spring Security? (也许我甚至会听到有人说有这样一个页面是一个很大的安全禁忌,我可以批评它。)
这可以帮助http://stackoverflow.com/questions/14141834/custom-securityexpressionroot-method-with-spring-security-3-1-3 – coder