All docs
V20.2
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.

RangePermission Class

A document range permission.

Declaration

export class RangePermission

Remarks

Refer to the following help topic for more information: Document Protection.

Properties

group Property

Returns the name of the user group with edit permission.

Declaration

readonly group: string

Property Value

Type Description
string

The group name.

Remarks

The Rich Text Editor defines several predefined groups: administrators, contributors, current, editors, everyone, and owners. Permissions set for everyone apply to all users. Other groups have no special meaning and you can associate them with different users.

NOTE

If you work with RTF files, remember that this format only keeps predefined groups. Other formats allow you to create custom group definitions.

var document = richEdit.document;
document.rangePermissions.create(document.interval, 'projectmanager@somecompany.com');
document.rangePermissions.create(document.paragraphs.getByIndex(10).interval, '', 'everyone');
document.rangePermissions.protectRange([document.paragraphs.find(6).interval], '', 'editors');

index Property

Returns the zero-based index of the permission in the RangePermissionCollection.

Declaration

readonly index: number

Property Value

Type Description
number

The permission's index.

Remarks

You can use the getByIndex(index) method to find a permission by its index in the RangePermissionCollection object.

var firstRangePermission = richEdit.document.rangePermissions.getByIndex(0);

interval Property

Returns the text buffer interval related to the range permission.

Declaration

readonly interval: Interval

Property Value

Type Description
Interval

The text buffer interval.

subDocument Property

Returns the sub-document where the range permission is applied.

Declaration

readonly subDocument: SubDocument

Property Value

Type Description
SubDocument

The sub-document.

userName Property

Returns the name of the user with edit permission.

Declaration

readonly userName: string

Property Value

Type Description
string

The username.

Methods

delete Method

Deletes the range permission.

Declaration

delete(): void