本文整理汇总了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");
}
}
示例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);
}
示例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");
// }
}
示例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());
}
示例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);
}