Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RangePermission Class

A document range permission.

#Declaration

TypeScript
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

TypeScript
get 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

TypeScript
get 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

TypeScript
get interval(): Interval

#Property Value

Type Description
Interval

The text buffer interval.

#subDocument Property

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

#Declaration

TypeScript
get subDocument(): SubDocument

#Property Value

Type Description
SubDocument

The sub-document.

#userName Property

Returns the name of the user with edit permission.

#Declaration

TypeScript
get userName(): string

#Property Value

Type Description
string

The username.

#Methods

#delete Method

Deletes the range permission.

#Declaration

TypeScript
delete(): void