ace.getValue().removeAll(removePermissions);
}
// create new ACE
if (!ace.getValue().isEmpty()) {
newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
new ArrayList<String>(ace.getValue())));
}
}
// find all ACEs that should be added but are not in the original ACE
// list
for (Map.Entry<String, Set<String>> ace : adds.entrySet()) {
if (!originals.containsKey(ace.getKey()) && !ace.getValue().isEmpty()) {
newAces.add(new AccessControlEntryImpl(new AccessControlPrincipalDataImpl(ace.getKey()),
new ArrayList<String>(ace.getValue())));
}
}
return new AccessControlListImpl(newAces);