From 7377b0ffe6a68e0d1f18be1091e5854ca5bd996b Mon Sep 17 00:00:00 2001 From: Moushmi Dhanislas Date: Mon, 29 Jun 2026 18:31:56 +0530 Subject: [PATCH 1/4] 1036262: Updated Restrict Editing --- .../asp-net-core/restrict-editing.md | 328 ++++++++++++++++-- 1 file changed, 307 insertions(+), 21 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md index bc4b28b45e..450d670ef5 100644 --- a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md +++ b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md @@ -1,36 +1,330 @@ --- layout: post -title: Restrict Editing in Document Editor Component| Syncfusion -description: Learn here all about Restrict Editing in Syncfusion Document Editor component of Syncfusion Essential JS 2 and more. +title: Restrict Editing in ASP.NET Core DOCX Editor | Syncfusion +description: Learn how to enable Restrict Editing in the ASP.NET Core DOCX Editor to control document changes. platform: document-processing control: Restrict Editing documentation: ug --- -# Restrict Editing in Document Editor Component +# Restrict Editing in ASP.NET Core DOCX Editor -Document Editor provides support to restrict editing. When the protected document includes range permission, then unique user or user group is only authorized to edit separate text area. +Syncfusion® ASP.NET Core DOCX Editor (Document Editor) provides support for restricting editing within a document. It enables control over how and where content can be modified. This helps limit editing so only specific sections of the document can be changed. + +## Configure on client side + +Document Editor provides options to protect and unprotect a document using the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection) and [stopProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#stopprotection) APIs, enabling various restricting editing operations. + +### Read only mode + +Document Editor supports protecting a document in read-only mode, where users can only view the content without making changes. + +The following example code illustrates how to enforce or remove read-only protection in the Document Editor. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +@using Syncfusion.EJ2 +@addTagHelper *, Syncfusion.EJ2 + + + + + Document Editor + + + + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +### Form filling mode + +Document Editor supports protecting a document with form-filling restrictions, allowing users to edit only form fields. + +The following example code illustrates how to enforce or remove form-filling restrictions in the Document Editor. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +@using Syncfusion.EJ2 +@addTagHelper *, Syncfusion.EJ2 + + + + + Document Editor + + + + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +### Comments only mode + +Document Editor supports protecting a document in comments-only mode, allowing users to add or edit comments only. + +The following example code illustrates how to enforce and remove comments-only protection in the Document Editor. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +@using Syncfusion.EJ2 +@addTagHelper *, Syncfusion.EJ2 + + + + + Document Editor + + + + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +### Track changes only mode + +Document Editor supports protecting a document in revisions-only mode, allowing users to view the document and make corrections while tracking all changes. Users cannot accept or reject tracked changes; only the author can review and finalize them later. + +The following example code illustrates how to enforce and remove revisions-only protection in the Document Editor. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +@using Syncfusion.EJ2 +@addTagHelper *, Syncfusion.EJ2 + + + + + Document Editor + + + + + + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +### Format restrictions + +Enforces document protection using the specified credentials. In the [enforceProtection](https://ej2.syncfusion.com/documentation/api/document-editor/editor#enforceprotection-1) method, the second parameter represents limitToFormatting, and the third parameter represents isReadOnly. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +container.documentEditor.editor.enforceProtection('password', true, true); + +{% endhighlight %} +{% endtabs %} + +## Configure on server side + +The above-mentioned hosted Web API URL is for demo and evaluation purposes only. For production, host your own web service as shown below. + +The Document Editor client requires a server-side API to generate a hash from the specified password and salt values, which is necessary for the restrict editing functionality. + +For more information on configuring restrict editing on the server side, refer to the following: + +- [Web Service for Restrict editing in ASP.NET Core](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/core#restrict-editing) + +- [Web Service for Restrict editing in ASP.NET MVC](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/mvc#restrict-editing) + +- [Web Service for Restrict editing in Java](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/java#restrict-editing) ## Set current user -You can use the `currentUser` property to authorize the current document user by name, email, or user group name. +The [currentUser](https://ej2.syncfusion.com/documentation/api/document-editor-container/documenteditor#currentuser) property can be used to authorize the current document user by name, email, or user group. + +The following code example demonstrates how to set the currentUser. -The following code shows how to set currentUser +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} -```typescript container.documentEditor.currentUser = 'engineer@mycompany.com'; -``` + +{% endhighlight %} +{% endtabs %} ## Highlighting the text area -You can highlight the editable region of the current user using the `userColor` property. +The [userColor](https://ej2.syncfusion.com/documentation/api/document-editor-container/index-default#usercolor) property can be used to highlight the editable region of the current user. + +The following code example demonstrates how to set the userColor. -The following code shows how to set userColor. +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} -```typescript container.documentEditor.userColor = '#fff000'; -``` + +{% endhighlight %} +{% endtabs %} + +The [highlightEditableRanges](https://ej2.syncfusion.com/documentation/api/document-editor-container/documenteditorsettingsmodel#highlighteditableranges) property can be used to toggle the highlighting of editable regions. + +The following code example demonstrates how to enable or disable editable region highlighting. + +{% tabs %} +{% highlight ts tabtitle="CSHTML" %} + +container.documentEditor.documentEditorSettings.highlightEditableRanges = true; + +{% endhighlight %} +{% endtabs %} ## Restrict Editing Pane @@ -41,12 +335,4 @@ Restrict Editing Pane provides the following options to manage the document: * To add users to the current document, select more users option and add user from the popup dialog. * To include range permission to the current document, select parts of the document and choose users who are allowed to freely edit them from the listed check box. * To apply the chosen editing restrictions, click the **YES,START ENFORCING PROTECTION** button. A dialog box displays asking for a password to protect. -* To stop protection, select **STOP PROTECTION** button. A dialog box displays asking for a password to stop protection. - -## Online Demo - -Explore how to restrict editing and protect Word documents using the ASP.NET Core Document Editor in this live demo [here](https://document.syncfusion.com/demos/docx-editor/asp-net-core/documenteditor/documentprotection#/tailwind3). - -* [How to protect the document in form filling mode](../asp-net-core/form-fields#protect-the-document-in-form-filling-mode) -* [How to protect the document in comments only mode](../asp-net-core/comments#protect-the-document-in-comments-only-mode) -* [How to protect the document in track changes only mode](../asp-net-core/track-changes#protect-the-document-in-track-changes-only-mode) \ No newline at end of file +* To stop protection, select **STOP PROTECTION** button. A dialog box displays asking for a password to stop protection. \ No newline at end of file From ddb043cfe3d7cc40d08d243a3c67bdd6487fbd4f Mon Sep 17 00:00:00 2001 From: Moushmi Dhanislas Date: Mon, 29 Jun 2026 18:36:07 +0530 Subject: [PATCH 2/4] 1036262: Updated Restrict editing md file --- .../asp-net-core/restrict-editing.md | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md index 450d670ef5..1e06dc5942 100644 --- a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md +++ b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md @@ -25,19 +25,6 @@ The following example code illustrates how to enforce or remove read-only protec {% tabs %} {% highlight ts tabtitle="CSHTML" %} -@using Syncfusion.EJ2 -@addTagHelper *, Syncfusion.EJ2 - - - - - Document Editor - - - - - - - {% endhighlight %} {% endtabs %} @@ -86,19 +72,6 @@ The following example code illustrates how to enforce or remove form-filling res {% tabs %} {% highlight ts tabtitle="CSHTML" %} -@using Syncfusion.EJ2 -@addTagHelper *, Syncfusion.EJ2 - - - - - Document Editor - - - - - - - {% endhighlight %} {% endtabs %} @@ -147,19 +119,6 @@ The following example code illustrates how to enforce and remove comments-only p {% tabs %} {% highlight ts tabtitle="CSHTML" %} -@using Syncfusion.EJ2 -@addTagHelper *, Syncfusion.EJ2 - - - - - Document Editor - - - - - - - {% endhighlight %} {% endtabs %} @@ -208,19 +166,6 @@ The following example code illustrates how to enforce and remove revisions-only {% tabs %} {% highlight ts tabtitle="CSHTML" %} -@using Syncfusion.EJ2 -@addTagHelper *, Syncfusion.EJ2 - - - - - Document Editor - - - - - - - {% endhighlight %} {% endtabs %} From 4533262beb1e75fbe9aa17c4ae16ff5d1134eaea Mon Sep 17 00:00:00 2001 From: Moushmi Dhanislas Date: Mon, 29 Jun 2026 19:18:53 +0530 Subject: [PATCH 3/4] 1036262: Resolved Front Matter error --- .../Word/Word-Processor/asp-net-core/restrict-editing.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md index 1e06dc5942..cacacd23d1 100644 --- a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md +++ b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md @@ -1,7 +1,7 @@ --- layout: post title: Restrict Editing in ASP.NET Core DOCX Editor | Syncfusion -description: Learn how to enable Restrict Editing in the ASP.NET Core DOCX Editor to control document changes. +description: Learn how to enable Restrict Editing in the ASP.NET Core DOCX Editor to control document changes effectively. platform: document-processing control: Restrict Editing documentation: ug @@ -224,11 +224,11 @@ The Document Editor client requires a server-side API to generate a hash from th For more information on configuring restrict editing on the server side, refer to the following: -- [Web Service for Restrict editing in ASP.NET Core](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/core#restrict-editing) +- [Web Service for Restrict editing in ASP.NET Core](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/restrict-editing) -- [Web Service for Restrict editing in ASP.NET MVC](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/mvc#restrict-editing) +- [Web Service for Restrict editing in ASP.NET MVC](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/restrict-editing) -- [Web Service for Restrict editing in Java](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/web-services/java#restrict-editing) +- [Web Service for Restrict editing in Java](https://help.syncfusion.com/document-processing/word/word-processor/asp-net-core/restrict-editing) ## Set current user From e82224ada4f638ce794e51eadf13aaf8497d5cdf Mon Sep 17 00:00:00 2001 From: Moushmi Dhanislas Date: Mon, 29 Jun 2026 19:55:02 +0530 Subject: [PATCH 4/4] 1036262: Updated description --- .../Word/Word-Processor/asp-net-core/restrict-editing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md index cacacd23d1..5fe46efa74 100644 --- a/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md +++ b/Document-Processing/Word/Word-Processor/asp-net-core/restrict-editing.md @@ -1,7 +1,7 @@ --- layout: post title: Restrict Editing in ASP.NET Core DOCX Editor | Syncfusion -description: Learn how to enable Restrict Editing in the ASP.NET Core DOCX Editor to control document changes effectively. +description: Learn how to enable Restrict Editing in the ASP.NET Core DOCX Editor to securely manage document access and control user modifications. platform: document-processing control: Restrict Editing documentation: ug