cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a document as Immutable

simpoir_
Champ on-the-rise
Champ on-the-rise

I've got a use case where, under certain conditions, a document needs to be read-only. I'm trying to achieve this state programmatically (using a chain/script). As the platform doesn't seem to allow to add the "Immutable" facet using the DocumentModel.addFacet(), I was wondering which alternative would be recommended:

  • by adding an ACE to deny all Write access to everyone;
  • by setting the HiddenInNavigation facet and putting a proxy to it in its place;
  • all of the above?
  • any other way?

Thanks in advance!

1 ACCEPTED ANSWER

bruce_Grant
Elite Collaborator
Elite Collaborator

Personally, I would modify the Access Control Entry to deny write access to everyone as it's the cleanest approach. I have done this in a number of scenarios and it works well.

View answer in original post

3 REPLIES 3

sdenef_
Confirmed Champ
Confirmed Champ

Can the publishing feature help you ? see http://doc.nuxeo.com/x/ZIEk

Published documents are read only.

bruce_Grant
Elite Collaborator
Elite Collaborator

Personally, I would modify the Access Control Entry to deny write access to everyone as it's the cleanest approach. I have done this in a number of scenarios and it works well.

after experimenting a bit, the ACL seems indeed cleaner and has the nice added value of keeping the version and audit log easily accessible, unlike when publishing