cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to reject document modification in a listener?

Dirk_Wenke
Confirmed Champ
Confirmed Champ

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

2 REPLIES 2

Florent_Guillau
World-Class Innovator
World-Class Innovator

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.

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?