Hopefully it is that simple (I'm using that code on a couple of scripts) :) On contentobject_version you have creator_id and user_id, but neither has anything to do with the owner of the object, the last one even looks unused in a trunk database.
Edit: I'm using it in a content edit handler, so in a cli script you need to clear content cache as well for the object.
I was just wondering about what documentation says:
http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_management/the_content_object <i>The object's owner contains a reference to the user who initially created the object. At any time, an object can only be owned by one user. This reference is set by the system the first time the object is published. The ownership of an object can not be manipulated and will not change even if the owner the object is removed from the system.</i>
"At any time, an object can only be owned by one user" - this sounds promising, but:
"The ownership of an object can not be manipulated..." - now, I wonder if this was written only because there was no GUI tool for that operation, or for some more technical reason...
Why didn't the ownership change make it as a default functionality?
Are we sure creator ID will not be mistaken for owner ID anywhere in the code?
Yes indeed, it's written there like this because there is no GUI by default in eZ Publish to change ownership of objects. However, there are some extensions out there for a long while which do the job: http://projects.ez.no/owner
It might be that in the admin and/or user interface there are captions like "Creator" where the actual owner of the object is listed. While there should actually be the creator of the first version.
PS. Actually, I think it's good that these pieces of information are separated, because they represent different info. Object or version creator may be one thing, object current owner another one. Question remains: is better object ownership management in any eZ Publish roadmap? Will that ever make it to the core?
It's not on the roadmap anywhere afaik. You might put an enhancement request in the issue tracker for it. Simply adding a "creator" field to the content object table in addition to the owner field would already get us further.