当前位置: 首页>>代码示例>>Java>>正文


Java MutableAcl.getParentAcl方法代码示例

本文整理汇总了Java中org.springframework.security.acls.model.MutableAcl.getParentAcl方法的典型用法代码示例。如果您正苦于以下问题:Java MutableAcl.getParentAcl方法的具体用法?Java MutableAcl.getParentAcl怎么用?Java MutableAcl.getParentAcl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.security.acls.model.MutableAcl的用法示例。


在下文中一共展示了MutableAcl.getParentAcl方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateObjectIdentity

import org.springframework.security.acls.model.MutableAcl; //导入方法依赖的package包/类
/**
 * Updates an existing acl_object_identity row, with new information presented in the passed MutableAcl
 * object. Also will create an acl_sid entry if needed for the Sid that owns the MutableAcl.
 *
 * @param acl to modify (a row must already exist in acl_object_identity)
 *
 * @throws NotFoundException if the ACL could not be found to update.
 */
protected void updateObjectIdentity(MutableAcl acl) {
    Long parentId = null;

    if (acl.getParentAcl() != null) {
        Assert.isInstanceOf(ObjectIdentityImpl.class, acl.getParentAcl().getObjectIdentity(),
            "Implementation only supports ObjectIdentityImpl");

        ObjectIdentityImpl oii = (ObjectIdentityImpl) acl.getParentAcl().getObjectIdentity();
        parentId = retrieveObjectIdentityPrimaryKey(oii);
    }

    Assert.notNull(acl.getOwner(), "Owner is required in this implementation");

    Long ownerSid = createOrRetrieveSidPrimaryKey(acl.getOwner(), true);
    int count = jdbcTemplate.update(updateObjectIdentity,
            parentId, ownerSid, Boolean.valueOf(acl.isEntriesInheriting()), acl.getId());

    if (count != 1) {
        throw new NotFoundException("Unable to locate ACL to update");
    }
}
 
开发者ID:GovernIB,项目名称:helium,代码行数:30,代码来源:JdbcMutableAclService.java

示例2: updateObjectIdentity

import org.springframework.security.acls.model.MutableAcl; //导入方法依赖的package包/类
/**
 * Updates an existing acl_object_identity row, with new information presented in the passed MutableAcl
 * object. Also will create an acl_sid entry if needed for the Sid that owns the MutableAcl.
 *
 * @param acl to modify (a row must already exist in acl_object_identity)
 *
 * @throws NotFoundException if the ACL could not be found to update.
 */
protected void updateObjectIdentity(MutableAcl acl) {
    String parentId = null;

    if (acl.getParentAcl() != null) {
        Assert.isInstanceOf(ObjectIdentityImpl.class, acl.getParentAcl().getObjectIdentity(),
            "Implementation only supports ObjectIdentityImpl");

        ObjectIdentityImpl oii = (ObjectIdentityImpl) acl.getParentAcl().getObjectIdentity();
        parentId = retrieveObjectIdentityPrimaryKey(oii);
    }

    Assert.notNull(acl.getOwner(), "Owner is required in this implementation");

    String ownerSid = createOrRetrieveSidPrimaryKey(acl.getOwner(), true);
    AclObjectIdentity aoi = objectIdentityRepository.findOne((String)acl.getId());
    if (aoi == null) {
        throw new NotFoundException("Unable to locate ACL to update");
    }
    aoi.setParentObjectId(parentId);
    aoi.setOwnerId(ownerSid);
    aoi.setEntriesInheriting(Boolean.valueOf(acl.isEntriesInheriting()));
    objectIdentityRepository.save(aoi);
}
 
开发者ID:AlexCzar,项目名称:spring-security-acl-mongodb,代码行数:32,代码来源:MongodbMutableAclService.java

示例3: updateObjectIdentity

import org.springframework.security.acls.model.MutableAcl; //导入方法依赖的package包/类
/**
     * Updates an existing acl_object_identity row, with new information presented in the passed MutableAcl
     * object. Also will create an acl_sid entry if needed for the Sid that owns the MutableAcl.
     *
     * @param acl to modify (a row must already exist in acl_object_identity)
     *
     * @throws NotFoundException if the ACL could not be found to update.
     */
    protected void updateObjectIdentity(MutableAcl acl) {
        AclObjectIdentity parentId = null;

        if (acl.getParentAcl() != null) {
            Assert.isInstanceOf(ObjectIdentityImpl.class, acl.getParentAcl().getObjectIdentity(),
                    "Implementation only supports ObjectIdentityImpl");

            AclObjectIdentity oii = (AclObjectIdentity) acl.getParentAcl().getObjectIdentity();
            parentId = retrieveObjectIdentityPrimaryKey(oii);
        }

        Assert.notNull(acl.getOwner(), "Owner is required in this implementation");

        AclSid ownerSid = createOrRetrieveSidPrimaryKey(acl.getOwner(), true);
        //TODO: Fixme:
//        aclObject.setParentObject(parentId);
//        aclObject.setOwner(ownerSid);
//        aclObject.setEntriesInheriting(Boolean.valueOf(acl.isEntriesInheriting()));
//
        // FIXME: This has to occur:
//        boolean update = aclDao.updateObjectIdentity(aclObject);

//        if (!update) {
//            throw new NotFoundException("Unable to locate ACL to update");
//        }
    }
 
开发者ID:PacktPublishing,项目名称:Spring-Security-Third-Edition,代码行数:35,代码来源:JpaMutableAclService.java

示例4: updateAcl

import org.springframework.security.acls.model.MutableAcl; //导入方法依赖的package包/类
@Override
public MutableAcl updateAcl(MutableAcl acl) throws NotFoundException {
    Assert.notNull(acl.getId(), "Object Identity doesn't provide an identifier");

    DBObject persistedAcl = getAclCollection().findOne(queryByObjectIdentity(acl.getObjectIdentity()));

    if (persistedAcl == null) {
        LOG.trace(ACL, "No ACL found for object identity {}", acl.getObjectIdentity());

        throw new NotFoundException("No acl found for object identity " + acl.getObjectIdentity());
    }

    LOG.debug(ACL, "Updating persisted ACL object");

    if (acl.getParentAcl() != null) {
        ObjectIdentity parentOid = acl.getParentAcl().getObjectIdentity();
        persistedAcl.put(parentObjectFieldName, toDBObject(parentOid));
    }

    persistedAcl.put(ownerFieldName, toDBObject(acl.getOwner()));
    persistedAcl.put(entriesInheritingFieldName, acl.isEntriesInheriting());

    BasicDBList list = new BasicDBList();
    for (AccessControlEntry entry : acl.getEntries()) {
        list.add(toDBObject(entry));
    }
    persistedAcl.put(entriesFieldName, list);

    getAclCollection().save(persistedAcl, writeConcern);

    LOG.trace(ACL, "Clearing cache including children for object identity {}", acl.getObjectIdentity());

    clearCacheIncludingChildren(acl.getObjectIdentity());

    LOG.trace(ACL, "Retrieve ACL via superclass.");

    return (MutableAcl) super.readAclById(acl.getObjectIdentity());
}
 
开发者ID:cedac-software,项目名称:spring-security-mongodb,代码行数:39,代码来源:MongoMutableAclService.java

示例5: updateObjectIdentity

import org.springframework.security.acls.model.MutableAcl; //导入方法依赖的package包/类
/**
 * Update Object Identity
 * 
 * @param acl
 */
protected void updateObjectIdentity(MutableAcl acl) {
	String parentId = null;

	if (acl.getParentAcl() != null) {
		Assert.isInstanceOf(ObjectIdentityImpl.class, acl.getParentAcl()
				.getObjectIdentity(),
				"Implementation only supports ObjectIdentityImpl");

		ObjectIdentityImpl oii = (ObjectIdentityImpl) acl.getParentAcl()
				.getObjectIdentity();
		parentId = retrieveObjectIdentityId(oii);
	}

	Assert.notNull(acl.getOwner(),
			"Owner is required in this implementation");

	SidNode ownerSid = createOrRetrieveSid(acl.getOwner(), true);
	AclNode aclNode = retrieveAclNode(acl.getObjectIdentity());

	if (aclNode == null) {
		throw new NotFoundException("Unable to locate ACL to update");
	}

	aclNode.setOwnerSid(ownerSid);
	aclNode.setParentObject(parentId);
	aclNode.setEntriesInheriting(acl.isEntriesInheriting());

	neo4jTemplate.save(aclNode);
}
 
开发者ID:shazin,项目名称:spring-security-acl-neo4j,代码行数:35,代码来源:Neo4jMutableAclService.java


注:本文中的org.springframework.security.acls.model.MutableAcl.getParentAcl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。