Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Collapse]Rich Text Editor
    Overview
   [Expand]Getting Started
   [Collapse]Fundamentals
    [Expand]RichEditControl
    [Collapse]Document
      Document Model
      Document Layout
      Positions and Ranges
      Characters
      Paragraphs
      Inline Pictures
      Document Fields
      Hyperlinks and Bookmarks
      Headers and Footers
      Tables
      Range Permissions
      Sections
      Styles
      Numbered and Bulleted Lists
      Floating Objects (Shapes)
      Text Boxes
      Comments
      Document Properties
     Supported Document Formats
    [Expand]Fields
     Commands
     Services
     Layout API
     Product Class Structure
     Default Keyboard Shortcuts
     Measure Units
     HTML Tag Interpretation
   [Expand]Concepts
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

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.

The How to: Create Protected Ranges in a Document topic provides a step-by-step guide on how to protect document ranges using the Rich Text Editor Ribbon UI.

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 RichEditControl.ReplaceService<T> 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 RichEditControl.ReplaceService<T> method. The IUserGroupListService.GetUserGroups method should return the list of added group names.

Expanded See Also

How would you rate this topic?​​​​​​​