2011-06-16 87 views

回答

1

您應該能夠使用protect-pointcut元素在你的命名空間配置。

Here的如何。

另外如果你第一次這樣做我強烈建議先做this教程。

1

我沒有找到關於你指定的教程春季安全的任何註解,「彈簧security.xml文件」是所有你想在tutorial.you可以找到here also.Spring提供了唯一的方法安全註解,雖然你可以使用保護-切入點根據上面的切入點確保methods.For例如

<global-method-security> 
    <protect-pointcut expression="execution(* *..service.UserManager.getUsers(..))" access="ROLE_ADMIN"/> 
    </global-method-security> 

,只與ROLE_ADMIN角色的用戶將能夠調用THES的UserManager的CLSS getUsers()方法。