if(doc == null) {
transact.abort(transaction);
throw new XPathException("Resource or collection '" + pathUri.toString() + "' does not exist.");
}
final Permission permissions = doc.getPermissions();
<BUG>permissionModifier.modify(permissions);
</BUG>
broker.storeXMLResource(transaction, doc);
transact.commit(transaction);
broker.flush();

if(doc == null) {
transact.abort(transaction);
throw new XPathException("Resource or collection '" + pathUri.toString() + "' does not exist.");
}
final Permission permissions = doc.getPermissions();
permissionModifier.accept(permissions);
broker.storeXMLResource(transaction, doc);
transact.commit(transaction);
broker.flush();
