Dashboard > SpringSide3 Wiki > ... > Reference > Security
  SpringSide3 Wiki Log In | Sign Up   View a printable version of the current page.  
  Security
Added by Calvin, last edited by Calvin on 2008-10-19  (view change)
Labels: 
(None)

1. 资料

2. in SpringSide 3.0

2.1 Login/Logout/Remember Me

     使用SpringSecurity自带的Login/Logout、RememerMe机制,自己编写UserDetailServiceImpl类负责向SpringSecurity提供身份和授权信息,用户授权由用户拥有的角色的授权组成。

2.2 授权控制

     授权在配置文件默认前缀为ROLE_*,注意这里并非角色的意思(见RoleVoter,可配置为其他前缀)。

  1. 在applicationContext-security.xml配置文件中配置URL访问控制。
  2. 在JSP中使用taglib控制页面显示内容。
  3. 在POJO中使用annotation控制函数访问

     JSP中使用taglib控制页面显示内容是必须的,避免普通用户误进入不该进的地方。
     而对别有用心用户的防止,可以采用applicationContext-security.xml中配置URL访问控制,也可以直接在Controller或Service层用annotation控制。采用哪种方式由开发人员自行选择。

2.3 权限模式

    SpringSecurity的权限定义很宽松灵活,只有用户与授权两级,大家可以在两者之间加上角色,用户组等级别。
    我们推荐的模式如下:

  1. 授权由程序员规划,名为ROLE_*,直接在代码/jsp/applicationContext.xml中硬编码(见上)。
    另外在数据库中存储ROLE_*对应的中文名称,方便客户的管理界面.
  2. 角色及所拥有的授权,由客户通过管理界面配置,数据存储到数据库中。
  3. 用户及所拥有的角色,同样由客户通过管理界面配置,数据存储在数据库中。

发现一个更好的,更好用的安全框架jsecurity,老大能否考虑替换掉庞大的ascige

Posted by Anonymous at 2008-08-17 13:18 | Permalink | Reply To This

谢谢推荐,好像jsecurity已进入apache孵化器了,我们将继续观察。

Posted by Calvin at 2008-09-21 23:34 | Permalink | Reply To This

非常谢谢,今天开始用springside,不过直接用源码,便于修改。发现很多东西都很好,annotation比较不熟悉,还没仔细看。acegi今天看了有不少迷糊的。看了这几段话,有把握多了。愿springside越来越好。对了,我也注册了论坛了,不过还不让发贴。多多跟大大们学习

Posted by Anonymous at 2008-11-26 23:59 | Permalink | Reply To This
Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 2006-09-07) - Bug/feature request - Contact Administrators