- 浏览: 124872 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
弦月001:
楼主目前对jcifs还记得吗?我目前在做jcifs sso研究 ...
JCIFS支持多域的SSO -
jusescn:
effort.mjb 写道博主好,请问怎么样才能直接获取到当前 ...
JCIFS支持多域的SSO -
effort.mjb:
博主好,请问怎么样才能直接获取到当前客户端的用户的域信息呢?( ...
JCIFS支持多域的SSO -
jusescn:
yingzhor 写道博主,您好。 如果,我想扩展一下,如果客 ...
JCIFS支持多域的SSO -
yingzhor:
博主,您好。 如果,我想扩展一下,如果客户端不再域内,直接把请 ...
JCIFS支持多域的SSO
实现效果图如下:
acegi1.05的新的权限模型针对 hsqldb 数据库,移植到到sqlserver/mysql 需要修改如下文件:
org.acegisecurity.acls.jdbc.BasicLookupStrategy ;
org.acegisecurity.acls.jdbc.JdbcMutableAclService;
JdbcMutableAclService 是最主要的类,对acl和ace的操作都集中在该类;
BasicLookupStrategy 只有一个方法readAclsById 获得实例对象的acl。
要点:
1、搭建基础代码可以参考ss2中的acegi实现(完全拷贝),在roleManager中需要特别注意是,如果采用getHibernateTemplate().saveOrUpdate(o);对对象进行保存或者更新的话,在修改角色对于用户或者角色对应资源的保存角色前,应该将缓存中的role对于的用户和资源的authorities清除rolename,然后更新角色实例,保存角色到cache中。
2、采用ss1中对对象保护的方法,新建com.at21.pm.core.security.acl.domain.AclDomainAware标示接口或者需要实现public long getId()方法。
3、编辑applicationContext-acegi-acl.xml(可以拷贝acegi中contact例子中的文件)。
4、解析acl中几个表对象
ACL_SID:用以保存sid的实例 PrincipalSid 用户实例,GrantedAuthoritySid 角色实例。
ACL_OBJECT_IDENTITY:用户需要保存的实例。字段ENTRIES_INHERITING表示是否继承父级权限。
ACL_ENTRY:用户实例对应sid的权限(read/create/delete/admin) 字段MASK标示权限(具体标示参考org.acegisecurity.acls.domain.BasePermission类)字段GRANTING表示是是否授予某用户/角色该实例的某权限
介绍开发树形实例:
1、保存树形到数据库对应表时,保存该对象到acl模型中调用updateAcl()方法。
- /**
- * @param clazz 需要保护的对象类
- * @param id 实例对象id
- * @param sid 角色名/用户名
- * @param permission 权限
- * @param granting 授予/拒绝
- * @param entriesInheriting 是否从父类继承权限
- * @param parentid 父类实例
- */
- public void updateAcl(Class clazz,Serializable id,Sid sid,Permission permission,boolean granting,boolean entriesInheriting,Serializable parentid){
- MutableAcl acl;
- ObjectIdentity oid = new ObjectIdentityImpl(clazz,id);
- try {
- acl = (MutableAcl) mutableAclService.readAclById(oid);
- } catch (NotFoundException nfe) {
- acl = mutableAclService.createAcl(oid);
- }
- if ( parentid != null){
- MutableAcl parentacl;
- ObjectIdentity parentoi = new ObjectIdentityImpl(clazz,parentid);
- try {
- parentacl = (MutableAcl) mutableAclService.readAclById(parentoi);
- } catch (NotFoundException nfe) {
- parentacl = mutableAclService.createAcl(parentoi);
- }
- acl.setParent(parentacl);
- }
- AccessControlEntry sameAce = null;
- AccessControlEntry[] aces = acl.getEntries();
- if ( aces != null && aces.length >0 ){
- for (int i = 0; i < aces.length; i++) {
- AccessControlEntry ace = aces[i];
- if ( ace.getPermission().getMask() == permission.getMask() && sid.equals(ace.getSid())){
- sameAce = ace;
- break;
- }
- }
- }
- if ( sameAce != null){
- acl.deleteAce(sameAce.getId());
- }
- acl.insertAce(null, permission, sid, granting);
- acl.setEntriesInheriting(entriesInheriting);
- mutableAclService.updateAcl(acl);
- }
如果是从后台直接保存树形(比如采用线程定时更新树形的话),没有web层的请求的话,需要用户后台登陆
保存前添加如下代码
- Authentication authRequest = new UsernamePasswordAuthenticationToken(admin,admin,new GrantedAuthority[]{new GrantedAuthorityImpl(role_admin)});
- SecurityContextHolder.getContext().setAuthentication(authRequest);
- String nodeid = request.getParameter("nodeid");
- String rolename = request.getParameter("rolename");
- String mark = request.getParameter("mark");
- String granted = request.getParameter("granted");
- Permission p = mutableAclService.buildFromMask(Integer.parseInt(mark));
- updateAcl(Vssdoc.class, Long.parseLong(nodeid), new GrantedAuthoritySid(rolename), p, Boolean.parseBoolean(granted), true, null);
评论
<div class='dp-highlighter'>
<div class='bar'/>
<ol class='dp-xml'>
<li class='alt'><span><span class='tag'><?</span><span class='tag-name'>xml</span><span> </span><span class='attribute'>version</span><span>=</span><span class='attribute-value'>"1.0"</span><span> </span><span class='attribute'>encoding</span><span>=</span><span class='attribute-value'>"UTF-8"</span><span class='tag'>?></span><span> </span></span></li>
<li class=''><span><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span/><span class='tag'><</span><span class='tag-name'>beans</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span> </span></li>
<li class='alt'><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.springframework.beans.factory.config.FieldRetrievingFactoryBean"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"staticField"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.READ"</span><span> </span></li>
<li class='alt'><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.springframework.beans.factory.config.FieldRetrievingFactoryBean"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"staticField"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.READ"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.DELETE"</span><span> </span></li>
<li class='alt'><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.springframework.beans.factory.config.FieldRetrievingFactoryBean"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"staticField"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.DELETE"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='comments'><!-- An access decision voter that reads ACL_CONTACT_READ configuration settings --></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclReadVoter"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.vote.AclEntryVoter"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclService"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ACL_READ"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.READ"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"processDomainObjectClass"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"com.at21.pm.core.security.acl.domain.AclDomainAware"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='comments'><!-- An access decision voter that reads ACL_CONTACT_DELETE configuration settings --></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclDeleteVoter"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.vote.AclEntryVoter"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclService"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ACL_DELETE"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.DELETE"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"processDomainObjectClass"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"com.at21.pm.core.security.acl.domain.AclDomainAware"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='comments'><!-- An access decision voter that reads ACL_CONTACT_ADMIN configuration settings --></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclAdminVoter"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.vote.AclEntryVoter"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclService"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ACL_ADMIN"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"processDomainObjectClass"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"com.at21.pm.core.security.acl.domain.AclDomainAware"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='comments'><!-- An access decision manager used by the business objects --></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"ACLaccessDecisionManager"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.vote.AffirmativeBased"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"allowIfAllAbstainDecisions"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"false"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"decisionVoters"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>bean</span><span>=</span><span class='attribute-value'>"roleVoter"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"aclReadVoter"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"aclDeleteVoter"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"aclAdminVoter"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclCache"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.jdbc.EhCacheBasedAclCache"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.springframework.cache.ehcache.EhCacheFactoryBean"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"cacheManager"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.springframework.cache.ehcache.EhCacheManagerFactoryBean"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"cacheName"</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"aclCache"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"lookupStrategy"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.jdbc.BasicLookupStrategy"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"dataSource"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclCache"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclAuthorizationStrategy"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.ConsoleAuditLogger"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclAuthorizationStrategy"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.AclAuthorizationStrategyImpl"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.GrantedAuthorityImpl"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ROLE_ADMINISTRATOR"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.GrantedAuthorityImpl"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ROLE_ADMINISTRATOR"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.GrantedAuthorityImpl"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>value</span><span>=</span><span class='attribute-value'>"ROLE_ADMINISTRATOR"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"aclService"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.jdbc.JdbcMutableAclService"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"dataSource"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"lookupStrategy"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"aclCache"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"afterInvocationManager"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.afterinvocation.AfterInvocationProviderManager"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"providers"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"afterAclRead"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"afterAclCollectionRead"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='comments'><!-- Processes AFTER_ACL_COLLECTION_READ configuration settings --></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"afterAclCollectionRead"</span><span> </span></li>
<li class='alt'><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.afterinvocation.AclEntryAfterInvocationCollectionFilteringProvider"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>bean</span><span>=</span><span class='attribute-value'>"aclService"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.READ"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='comments'><!-- Processes AFTER_ACL_READ configuration settings --></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"afterAclRead"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.afterinvocation.AclEntryAfterInvocationProvider"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>bean</span><span>=</span><span class='attribute-value'>"aclService"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.ADMINISTRATION"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"org.acegisecurity.acls.domain.BasePermission.READ"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>list</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>constructor-arg</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>bean</span><span> </span><span class='attribute'>id</span><span>=</span><span class='attribute-value'>"securityInterceptor"</span><span> </span><span class='attribute'>class</span><span>=</span><span class='attribute-value'>"org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"validateConfigAttributes"</span><span class='tag'>></span><span class='tag'><</span><span class='tag-name'>value</span><span class='tag'>></span><span>false</span><span class='tag'></</span><span class='tag-name'>value</span><span class='tag'>></span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"authenticationManager"</span><span> </span><span class='attribute'>ref</span><span>=</span><span class='attribute-value'>"authenticationManager"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"accessDecisionManager"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"ACLaccessDecisionManager"</span><span class='tag'>/></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"afterInvocationManager"</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>local</span><span>=</span><span class='attribute-value'>"afterInvocationManager"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>property</span><span> </span><span class='attribute'>name</span><span>=</span><span class='attribute-value'>"objectDefinitionSource"</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='tag'><</span><span class='tag-name'>ref</span><span> </span><span class='attribute'>bean</span><span>=</span><span class='attribute-value'>"objectDefinitionSource"</span><span class='tag'>/></span><span> </span></li>
<li class=''><span> </span></li>
<li class='alt'><span> </span><span class='tag'></</span><span class='tag-name'>property</span><span class='tag'>></span><span> </span></li>
<li class=''><span> </span><span class='tag'></</span><span class='tag-name'>bean</span><span class='tag'>></span><span> </span></li>
<li class='alt'><span> </span></li>
<li class=''><span/><span class='tag'></</span><span class='tag-name'>beans</span><span class='tag'>></span><span> </span></li>
</ol>
</div>
<font>applicationContext-acegi-acl.xml</font>
相关推荐
acegi,spring的安全验证框架
- **细粒度的权限控制**:支持URL级别的权限管理,使得开发者能够精确地控制不同用户或角色对于特定资源的访问权限。 - **业务逻辑与安全检查的解耦**:通过AOP技术将业务逻辑与安全检查逻辑分离,确保两者相互独立...
权限是更细粒度的访问控制,可以精确到操作级别的控制。AceGI可以通过配置实现基于角色的访问控制(RBAC)或基于权限的访问控制(PBAC)。 在实际应用中,AceGI的配置通常在Spring的配置文件中完成,通过定义...
在本实例中,我们将深入探讨如何使用Acegi来控制用户的权限。Acegi Security已经被Spring Security替代,但其核心思想和机制仍然适用于现代的Spring Security。 首先,我们需要理解Acegi的基础概念。Acegi的核心是`...
### acegi+SSH动态实现基于角色的权限管理 在企业级应用开发中,权限管理和用户认证是必不可少的安全机制。本文将详细介绍如何利用Acegi安全框架(现称为Spring Security)结合SSH(Struts + Spring + Hibernate)...
总结一下,Acegi是一个强大的安全框架,它提供了细粒度的权限控制,能够做到按钮或HTML元素级别的权限管理。通过自定义策略和配置,可以轻松地集成到Spring应用程序中,并部署在Tomcat服务器上。"acegi-demo"项目是...
RBAC是一种广泛采用的权限模型,通过角色来分配权限,有效地实现了用户与权限之间的间接关联,降低了权限管理的复杂性。 Acegi Security是Spring框架的一个扩展,它为Java应用程序提供了全面的安全性解决方案。在...
Spring Acegi权限控制是Spring框架中用于实现Web应用安全的一种解决方案。Acegi Security(现已被Spring Security替代)是一个功能强大的安全框架,它主要解决了认证(Authentication)和授权(Authorization)这两...
Acegi支持多种访问控制策略,如`AccessDecisionVoter`的投票机制、表达式语言(如SpEL)进行细粒度控制等。这使得我们可以根据具体需求定制复杂的访问规则。 9. **异常处理** 当用户试图访问未授权的资源时,...
7. acegi-security-tiger-1.0.5.jar:这个组件是针对Java SE 5(也称为Tiger)的优化,确保框架在新版本的Java平台上能够高效运行。 8. license.txt、readme.txt和notice.txt:这些文件分别包含了框架的许可协议、...
acegi-security-1.0.5.jar java权限控制应用包下载
Acegi允许通过定义安全表达式、访问决策管理器和访问决策投票器来进行细粒度的授权控制。 3. **安全拦截**:Acegi利用Spring的AOP框架来实现对方法调用和URL访问的拦截。你可以定义安全拦截规则,例如,只有特定...
标题 "batis+acegi实现的动态权限控制" 暗示了这个项目是关于整合Spring框架中的Acegi安全模块和MyBatis ORM框架,来创建一个动态的权限管理系统。Acegi是Spring早期的安全组件,现在已被Spring Security所取代,但...
首先,Acegi的核心功能是提供细粒度的访问控制,允许开发者对应用中的资源(如URL、方法、对象等)设置特定的访问权限。它通过Spring AOP(面向切面编程)实现,使得权限检查可以在不修改业务代码的情况下进行。 1....
Acegi的安全模型允许精细的权限控制,可以基于角色、URL、方法甚至业务对象进行授权。它使用AOP(面向切面编程)来实现权限检查,可以在任何代码执行点进行安全拦截。 4. **会话管理(Session Management)**: ...
《基于Acegi、Appfuse2与Java的数据权限控制系统构建》 在信息技术领域,尤其是在企业级应用开发中,安全性和权限管理是至关重要的组成部分。本文将深入探讨如何利用Spring、Acegi框架以及Ext2.0库,结合MySQL...