Spring Security 能满足这些需求吗?
我已经在网站上阅读了一些有关 Spring Security 提供的功能..
但我只是想在深入研究甚至推出我自己的简单解决方案之前确定一下,希望能够得到使用 Spring Security 的经验丰富的开发人员的一些确认。
我目前正在使用 jsf2 + primefaces、spring3、jpa2 + hibernate 进行开发
我有这些需求:
- 拥有用户列表,用户组
- 需要在登录时对用户进行身份验证(这是非常基本的,必须已经支持)
- 安全系统可以为模块(java项目的包或可以被视为UI中的菜单/程序)进行配置,因此如果用户配置为能够访问菜单1和菜单3中的所有程序,并且只能访问菜单4中的1个程序,那么只有允许的菜单才会显示,直接访问不允许的菜单/程序 URL 会导致错误。
- 需要在只读级别、读/写级别等级别的服务方法(普通 java 方法)上对用户进行身份验证。例如,如果我们可以将 public void save(...) 配置为具有读/写访问权限,则只有获得读/写访问权限的用户才能调用此方法
- ,甚至可以在 JSF 2 xhtml 上扩展此方法,我可以利用 r 或 r/w 访问来启用/禁用按钮或链接或其他内容,可能以编程方式使用 jsf 组件的禁用属性。
- 如果其中一些功能(例如验证程序或服务方法)使用 AOP 透明地完成,而不弄脏业务流程代码,那就更好了。
请分享您对此的看法..
谢谢!
I've read the features a little bit on the site about what spring security offers ..
But i just want to make sure before diving down or even rolling my own simple solution, hoping some confirmations from experienced developers that made use of Spring security.
Im currently developing using jsf2 + primefaces, spring3, jpa2 + hibernate
I have these needs :
- have the list of users, and groups of users
- need to authenticate the user on login (this is so basic, it must be supported already)
- the security system can be configured for modules (packages of the java project or can be seen as menus / programs in the UI), so if user is configured to be able to access all programs in menu 1 and menu 3 and only 1 program in menu 4, then the menu will be displayed only for the allowed, and accessing directly on the unallowed menu / program URL will cause error.
- need to authenticate user on the service methods (plain java methods) on levels like readonly level, r/w level. So for example, if we can configure that public void save(...) to have the r/w access, only users that's given r/w access can call this method
- can even extend this on the JSF 2 xhtml, where i can make use of the r or r/w access to enable / disable buttons or links or other stuffs, perhaps programatically using the disabled attribute of a jsf component.
- would be better if some of these features like authenticating the program or the service methods are done transparently using AOP, without dirtying the business processes codes.
Please share your opinions on this ..
Thank you !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Spring Security 将支持您的大部分需求。
form-login 元素嵌套在安全配置中的 http 元素中。请参阅 http: //static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-getting-started
Spring Security would support most of your requirements.
form-login element nested in the http element in your security configuration. See http://static.springsource.org/spring-security/site/docs/3.0.x/reference/ns-config.html#ns-getting-started