transact.commit(transaction);
broker.flush();
} else {
transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
final Permission permissions = collection.getPermissionsNoLock();
<BUG>permissionModifier.modify(permissions);
</BUG>
broker.saveCollection(transaction, collection);
transact.commit(transaction);
broker.flush();

transact.commit(transaction);
broker.flush();
} else {
transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
final Permission permissions = collection.getPermissionsNoLock();
permissionModifier.accept(permissions);
broker.saveCollection(transaction, collection);
transact.commit(transaction);
broker.flush();
