Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+

RichEditControlOptionsBase.Authentication Property

Provides access to an object used to specify the identity parameters for range editing permissions.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.RichEdit.v20.2.Core.dll


public AuthenticationOptions Authentication { get; }

Property Value

Type Description

An AuthenticationOptions class instance that holds identity parameters.

Property Paths

You can access this nested property as listed below:

Library Object Type Path to Authentication
WinForms Controls SnapControl
WPF Controls RichEditControl
Office File API IRichEditDocumentServer
Reporting SyntaxEditor


This code snippet demonstrates how you can fetch usernames assigned to protected ranges in a document and identify the current user as being one of the particular users. It allows you to edit the range with editing permissions granted to that user.

The SubDocument.BeginUpdateRangePermissions method is used to get all permissions for document ranges. Call the SubDocument.CancelUpdateRangePermissions if you do not intend to modify them.

Then, we traverse the collection of range permissions and obtain user names via the RangePermission.UserName property. The ComboBoxEdit control is filled with the names, so an existing name can be selected to log in.

To log in (i.e. to specify the user whose permissions will be in effect), the RichEditControlOptionsBase.Authentication options are used.

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;
using DevExpress.XtraRichEdit.Services;
        void richEditControl1_DocumentLoaded(object sender, EventArgs e)
            richEditControl1.Options.Authentication.UserName = String.Empty;
        private void UpdateUserNameLoginCombo()
            RangePermissionCollection rangePermissions = richEditControl1.Document.BeginUpdateRangePermissions();
            List<String> users = new List<string>();
            foreach (RangePermission rangePermission in rangePermissions)
                string userName = rangePermission.UserName;
                if (users.Contains(userName))
                if (!String.IsNullOrEmpty(userName))
            foreach (MyUser user in myUserList) {
                if (!users.Contains(user.UserName)) cmbUserName.Properties.Items.Add(user.UserName);
            cmbUserName.SelectedIndex = 0;
            cmbUserName.SelectedValueChanged += cmbUserName_SelectedValueChanged;

        private void cmbUserName_SelectedValueChanged(object sender, EventArgs e)
            string username = cmbUserName.SelectedItem.ToString();
            richEditControl1.Options.Authentication.UserName = username;
            MyUser myuser = myUserList.Find(s => s.UserName == username);
            richEditControl1.Options.Authentication.Group = (myuser != null) ? myuser.Group : String.Empty;


The following code snippets (auto-collected from DevExpress Examples) contain references to the Authentication property.


The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also