在使用Spring MVC和Spring Security @PreAuthorize注释时,是否可以知道URL是否可访问?

在我们的Web项目中,我们使用的是Spring security 3.2.3.RELEASE和Spring MVC(以及其他Spring的东西)4.0.5.RELEASE。

我们的控制器方法注释如下:

@RequestMapping(value = "/register", method = RequestMethod.GET) @PreAuthorize("hasRole('ROLE_MANAGER')") public String register() { 

我的问题是,如果我的用户可以打电话,我是否可以提出弹簧安全问题

 http://localhost:8080/project/register 

主要目标是在呈现URL之前开发一个要调用的元数据,这样如果用户无法访问此URL,系统就不会呈现它。

我用JSF和Spring Security开发了类似的方法:

 @Autowired private WebInvocationPrivilegeEvaluator webInvocationPrivilegeEvaluator; public boolean allowedForAction(String action) { log.debug("Checking action/url:" + action); Authentication a = SecurityContextHolder.getContext().getAuthentication(); NavigationCase nc = ((ReloadAfterNavigationFix) FacesContext.getCurrentInstance().getApplication() .getNavigationHandler()).getNavigationCase(FacesContext.getCurrentInstance(), null, action); if (nc != null) { return webInvocationPrivilegeEvaluator.isAllowed(nc.getToViewId(FacesContext.getCurrentInstance()), a); } return false; } 

但我不确定webInvocationPrivilegeEvaluator是否适用于控制器中的注释方法,例如示例中的te。 我认为它只适用于spring-security.xml中配置的url模式

任何想法?