开发者

How do I programmatically test authorization for URLs in Spring Security?

I'm using Spring security 3.0.5 in a JSF 2 application.

In order to deactivate/hide entries in my navigation menu 开发者_运维技巧for users that are not permitted to access them, I need a way to programmatically test whether the currently logged in user is allowed to access a given URL.

What's the easiest way to do that?


I've found the solution myself: the API for this functionality is found in WebInvocationPrivilegeEvaluator, which can be acquired via an @Autowired spring bean.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜