private void handleAclModifications(String repositoryId, AtomEntry entry, Acl addAces, Acl removeAces) {
if (!isAclMergeRequired(addAces, removeAces)) {
return;
}
Acl originalAces = null;
// walk through the entry and find the current ACL
for (AtomElement element : entry.getElements()) {
if (element.getObject() instanceof CmisObjectType) {
// extract current ACL
CmisObjectType object = (CmisObjectType) element.getObject();
originalAces = convert(object.getAcl(), object.isExactACL());
break;
}
}
if (originalAces != null) {
// merge and update ACL
Acl newACL = mergeAcls(originalAces, addAces, removeAces);
if (newACL != null) {
updateAcl(repositoryId, entry.getId(), newACL, null);
}
}
}