Master collaboration permissions in Document Engine
Collaboration permissions define which actions users can take on a piece of content in a document: an annotation, an Instant Comment, or a form field. The actions depend on who created it and what its group is. Document Engine tracks this information for all annotations, comments, and form fields in every document.
This guide aims to describe both how you can manage this information via Document Engine APIs and how it changes during the document lifecycle.
Creator
Creator is an immutable property of every piece of content created with Document Engine. Document Engine attributes each annotation, comment, and form field to the user_id in the JSON Web Token (JWT) used to authenticate Nutrient Web SDK. If the JWT claims don’t include user_id, the creator of all content is set to null.
You can also pass the user_id parameter when creating annotations and comments through Document Engine’s API. As with the JWT, if you don’t provide user_id in either of these APIs, the default is null.
To inspect the creator of a piece of content, see the createdBy property when fetching annotations and comments.
You can assign and fetch the creator of form field values, but it isn’t useful, because form field permissions can’t depend on the creator.
Group
The group property gives you more flexibility when declaring permissions and managing access to content. Unlike the creator, the group of each annotation, comment, and form field is mutable. You can change it with Document Engine’s APIs or Nutrient Web SDK. Read more in the group section of the guide on setting user collaboration permissions to learn how groups work with Nutrient Web SDK.
Form field values and widget annotations always inherit their form field’s group, so you can’t set or update it directly through the Document Engine API.
Comments, on the other hand, can have a completely different group than their root annotation.
With Document Engine’s APIs, similar to the user_id, you can specify the group when creating annotations and comments. If you don’t provide the group, the default of null is used. You can also use the annotation update API to change the group of the annotation.
To see the group of a piece of content, check the group property when fetching annotations, comments, and form field values.
In Document Engine 1.19.0 and later, Instant JSON exports also include createdBy, updatedBy, and group metadata on annotations, comments, and form fields. These fields describe the exported records, but they don’t assign ownership or groups when imported.
Creator and Group in a Document Lifecycle
Some APIs, like the annotation creation API, directly create or modify content. Other Document Engine functionality can also add and update content in the document. The following list shows how these operations affect the ownership information of annotations, comments, and form fields:
- When you upload a document, the creator and group of every piece of content is
null. - Copying a document copies the creator and group information from the original document.
- Creating a layer with a
source_layer_nameparameter copies the creator and group information from the source layer. - Duplicating a page copies the creator and group information of content on that page.
- Importing a document by ID (and optionally layer name) copies the creator and group information from that document.
Supported client platforms
Collaboration Permissions is available in the following Nutrient frontend SDKs: