[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
   [Expand]Product Information
    Product Class Structure
    Supported Formats
   [Expand]Getting Started
   [Collapse]RichEditControl Document
    [Expand]Document Structure
    [Collapse]Document Elements
      Positions and Ranges
      Characters
      Paragraphs
      Inline Pictures
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Sections
      Styles
      Lists
      Shapes
      Text Boxes
      Comments
      Checkboxes
      Document Properties
   [Expand]Fields
    Text Formatting
    Import and Export
   [Expand]Page Layout
    Printing
    AutoCorrect
    Mail Merge
    Restrictions and Protection
    Syntax Highlighting
   [Expand]Visual Elements
    Services
    Events
    Commands
    HTML Tag Support
   [Expand]Examples
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Range Permissions

Range permissions use bookmarks to specify protected ranges (regions) in a document. While a document is protected, a range permission limits editing to a collection of users and user groups. Editable sections can be displayed with highlighting or enclosed in brackets, as illustrated in the following image.

Expanded Setting Permissions in Code

Call the SubDocument.BeginUpdateRangePermissions method to retrieve a collection of range permissions.

Set the RichEditControlOptionsBase.Authentication property to the current user name to make the range editable. Edit permission for a range requires one of the following to be true:

Use the RichEditControlOptionsBase.RangePermissions property to set range highlighting and bracket options. Call the Document.Protect and Document.Unprotect methods to enable and disable document protection, respectively. These methods do not require user input. A password can be passed as an argument to the Document.Protect method to protect the document. Calling the Document.Unprotect method disables protection, without the need for a password. To prompt the user for a password, execute the ProtectDocumentCommand and the UnprotectDocumentCommand commands instead.

Expanded Users and Groups

The list of users available in the Editing Permissions dialog is generated from the document ranges with permissions. Users may be added at runtime: provide a custom service implementing the IUserListService interface and register this service with the DevExpress.Xpf.RichEdit.RichEditControl.ReplaceService``1 method. The IUserListService.GetUsers method should return the list of added user names.

The user groups available in the Editing Permissions dialog is predefined. By default, the available groups are: Everyone, Administrators, Contributors, Owners, Editors and Current User. Groups other than Everyone have no special meaning. There is no built-in user name with elevated permissions.

Note

Users and groups range permissions are not compatible with Editing Restrictions in Microsoft Word. Only the predefined groups are saved in RTF format. Group names are not saved in DOC format.

By default, the RichEditControl does not associate users with groups, so user names and group names are independent. Similar to users, groups can be added at runtime: provide a custom service implementing the IUserGroupListService interface and register this service with the DevExpress.Xpf.RichEdit.RichEditControl.ReplaceService``1 method. The IUserGroupListService.GetUserGroups method should return the list of added group names.

Is this topic helpful?​​​​​​​