Posted on 2009-02-03 03:29
leekiang 閱讀(830)
評論(1) 編輯 收藏 所屬分類:
spring 、
權限
1,FilterSecurityInterceptor的objectDefinitionSource定義的是url與角色的關系,既可以在xml里寫死,也可以自定義一個FilterInvocationDefinitionSource,實現其public ConfigAttributeDefinition getAttributes(Object filter)方法。這個關系好像也可以定義在FilterChainProxy的filterInvocationDefinitionSource
http://www.javaeye.com/topic/113436
http://www.tkk7.com/redhatlinux/archive/2008/09/01/226010.html
http://www.webasp.net/article/29/28097_print.htm
定義好角色與url的關系,同時告訴acegi該用戶擁有的角色,那么acegi會根據投票規則去驗證是否有權限。
2,必須要設置httpSessionContextIntegrationFilter,否則就會報
org.springframework.security.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext
3,
其實所有的權限問題最終可以總結為: 當前的登陸用戶是誰,他擁有那些資源,
他現在所訪問的資源是否與與其匹配。 這個就是最基本的 用戶-資源 后來因用戶和資源經常性變化,
單一的用戶資源模型會導致經常性維護的麻煩,所以人們加入了角色一層,以方便更好的管理,
這就是 用戶-角色-資源(RBAC)模型。隨著系統的不斷增大,用戶和資源越來越多,
根據不同的項目的需要,人們又按需開發了不少模型,如 用戶-角色-權限-資源 模型,
用戶-角色-角色組-權限-資源 模型,用戶-角色-角色組-權限-操作-資源 模型等,
其實無論中間加入多少層,如何擴展,也都是萬變不離其宗:用戶-資源。
4,
手冊 http://family168.com/oa/springsecurity/html/
http://www.javaeye.com/topic/17896