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