# Protect Document Dialogs

These dialogs allow you to [protect the document](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/features/document-protection) by adding a password or change the edit restrictions.

## Protect and Unprotect Document Dialogs

![An image showing the protect document dialog of RadRichTextBox for WPF](https://www.telerik.com/products/wpf/documentation/assets/cbcf933899e7416e8f214316e0f9ee0c/richtextbox-dialogs-protect-document-0.png)

The protect document dialog can be opened from the **Protect Document** button in the **Review** tab of the [RadRichTextBoxRibbonUI](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/ui-for-applying-rich-text-formatting/features-radrichtextboxribbonui).

![An image showing the button that opens the protect document dialog of RadRichTextBox for WPF](https://www.telerik.com/products/wpf/documentation/assets/dd5200b2a919b6a32c515d27e07104de/richtextbox-dialogs-protect-document-1.png)

If the document is protected with a password, the **Protect Document** button will open the **Unprotect Document** dialog.

![An image showing the button that opens the unprotect document dialog of RadRichTextBox for WPF](https://www.telerik.com/products/wpf/documentation/assets/8b9cffcad126ecc1c912a6ffc38e2d6c/richtextbox-dialogs-protect-document-2.png)

## Editing Restrictions Dialog

![An image showing the editing resitrctions dialog of RadRichTextBox for WPF](https://www.telerik.com/products/wpf/documentation/assets/af560eef32ea55050e2ec5e60b1433ea/richtextbox-dialogs-protect-document-3.png)

This dialog can be opened from the **Editing Restrictions** button in the **Review** tab of the [RadRichTextBoxRibbonUI](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/ui-for-applying-rich-text-formatting/features-radrichtextboxribbonui).

![An image showing the button that opens the editing restrictions dialog of RadRichTextBox for WPF](https://www.telerik.com/products/wpf/documentation/assets/e31b5f2c963b8bb5cd1a56b198a75574/richtextbox-dialogs-protect-document-4.png)

## Showing the Dialogs Manually

The dialog can be shown by executing the following commands:

* `ToggleDocumentProtectionCommand`
* `ShowChangeEditingPermissionsDialogCommand`

See how to bind the commands to external buttons in the [Commands](https://www.telerik.com/products/wpf/documentation/controls/radrichtextbox/features/commands) article.

**Executing the show dialog command**

```C#
	this.richTextBox.Commands.ToggleDocumentProtectionCommand.Execute();
	
	this.richTextBox.Commands.ShowChangeEditingPermissionsDialogCommand.Execute(null);
```

Alternatively, you can use the following methods of `RadRichTextBox`:

* `ShowProtectDocumentDialog`
* `ShowUnprotectDocumentDialog`
* `ShowChangeEditingPermissionsDialog`

**Using the show dialog method**

```C#
	this.richTextBox.ShowProtectDocumentDialog();
	
	this.richTextBox.ShowChangeEditingPermissionsDialog();
```
