This happens because XWikiDocument#createXObject sets the content dirty.
Adding tags to a document change its content author
Annotation creation, and its effect on programming rights
Copying a document sets the creator to the current user
Add a script right to manage script macro execution permissions