TX Text Control allows you to protect documents with specific permissions and to protect documents from editing and formatting actions. Typically, a document is protected, exceptions are applied for specific users or user groups and the document is encrypted with a password. When opening such a document with TX Text Control without providing the master password, the permissions are applied and the document is protected automatically when the EditMode property is set to ReadAndSelect.
Initialize with User Names
The following MVC code shows how to initialize the document editor with this edit mode. Additionally, a specific user name is defined using the UserNames property:
This user name is used for all user specific actions such as track changes or document permissions. Let's consider that the user Paul is the main (admin) editor of a document. Using the Permissions tab, it is possible to add exceptions for specific users and user groups to sections by selecting text ranges and clicking on the user in the Mark Exceptions and set Users ribbon group.
This list of user names contains all users with active exceptions in the currently loaded document. The user is able to add additional users using the dialog box Add Users:
Adding Users Programmatically
After calling this code, it is only possible to add existing users (including the newly added users) to the list:
Adding Editable Regions
Using the editable
╰ FormattedText Object
╰ editableRegions Property
Gets a collection of all editable regions. property, it is possible to access existing regions as well as adding additional regions. The following code adds an editable region to the document for user email@example.com:
╰ EditableRegionCollection Object
Contains all editable regions in the main text or another part of a document. can be used to iterate over all existing regions in a document. The following code shows the user name of every editable region in the current document: