Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Document-Processing-toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -2650,7 +2650,7 @@
<li><a href="/document-processing/word/word-processor/angular/right-to-left">RTL</a></li>
<li><a href="/document-processing/word/word-processor/angular/chart">Chart</a></li>
<li><a href="/document-processing/word/word-processor/angular/content-control">Content Control</a></li>
<li><a href="/document-processing/word/word-processor/angular/document-management">Document Management</a></li>
<li><a href="/document-processing/word/word-processor/angular/restrict-editing">Restrict Editing</a></li>
<li><a href="/document-processing/word/word-processor/angular/spell-check">SpellCheck</a></li>
<li><a href="/document-processing/word/word-processor/angular/global-local">Globalization</a></li>
<li><a href="/document-processing/word/word-processor/angular/notes">Footnotes and Endnotes</a></li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
---
layout: post
title: Restrict editing in Angular Document editor component | Syncfusion
description: Learn here all about Restrict editing in Syncfusion Angular Document editor component of Syncfusion Essential JS 2 and more.
platform: document-processing
control: Restrict editing
documentation: ug
domainurl: ##DomainURL##
---

# Restrict Editing in Angular Document editor component

Document Editor provides support to restrict editing. When the protected document includes range permission, then unique user or user group only authorized to edit separate text area.

## Set current user

You can use the `currentUser` property to authorize the current document user by name, email, or user group name.

The following code shows how to set currentUser

```typescript
this.container.documentEditor.currentUser = 'engineer@mycompany.com';
```

## Highlighting the text area

You can highlight the editable region of the current user using the `userColor` property.

The following code shows how to set userColor.

```typescript
this.container.documentEditor.userColor = '#fff000';
```

You can toggle the highlight the editable region value using the "highlightEditableRanges" property.

The following code shows how to toggle the highlight editable region value.

```typescript
container.documentEditor.documentEditorSettings.highlightEditableRanges = true;
```

## Restrict Editing Pane

Restrict Editing Pane provides the following options to manage the document:
* To apply formatting restrictions to the current document, select the allow formatting check box.
* To apply editing restrictions to the current document, select the read only check box.
* 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.

The following code shows Restrict Editing Pane. To unprotect the document, use password '123'.

{% tabs %}
{% highlight ts tabtitle="app.component.ts" %}
{% include code-snippet/document-editor/angular/document-editor-container-cs1/src/app.component.ts %}
{% endhighlight %}

{% highlight ts tabtitle="main.ts" %}
{% include code-snippet/document-editor/angular/document-editor-container-cs1/src/main.ts %}
{% endhighlight %}
{% endtabs %}

{% previewsample "/document-processing/samples/document-editor/angular/document-editor-container-cs1" %}

> The Web API hosted link `https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/` utilized in the Document Editor's serviceUrl property is intended solely for demonstration and evaluation purposes. For production deployment, please host your own web service with your required server configurations. You can refer and reuse the [GitHub Web Service example](https://github.com/SyncfusionExamples/EJ2-DocumentEditor-WebServices) or [Docker image](https://hub.docker.com/r/syncfusion/word-processor-server) for hosting your own web service and use for the serviceUrl property.
## See Also

* [How to protect the document in form filling mode](./form-fields#protect-the-document-in-form-filling-mode)
* [How to protect the document in comments only mode](./comments#protect-the-document-in-comments-only-mode)
* [How to protect the document in track changes only mode](./track-changes#protect-the-document-in-track-changes-only-mode)
Footer