Is it possible to reject document modification in a listener?

Hi, my nuxeo bundle contains an EventListener that reacts on some events to add additional information to my documents. Now I am in a situation where I want to reject the modifications of a user. So I added a listener reacting on the beforeDocumentModification event. I thought that it might work to use event.markRollback(). But his will result in an error page for the user after modifying the document. Is there a “legal” way to do this?

Thanks, Dirk

0 votes

1 answers



No, listeners are not designed to be able to cancel things. There would be no way to properly propagate any error or messages back to the user in any case. You must find another mechanism to check that what you're about to do is allowed, before actually doing it.

0 votes

Thanks Florent, does Nuxeo provide an extension point to validate the content of the edit form of my document programmatically before the changes are applied?