Setting a document as Immutable

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!

0 votes

2 answers

795 views

ANSWER



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.

1 votes



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
08/10/2012


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

Published documents are read only.

0 votes