Back to Devexpress

RangePermission Class

aspnetcore-js-devexpress-dot-richedit-d9850015.md

latest2.9 KB
Original Source

RangePermission Class

A document range permission.

Declaration

ts
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

ts
get group(): string

Property Value

TypeDescription
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.

js
var document = richEdit.document;
document.rangePermissions.create(document.interval, '[email protected]');
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

ts
get index(): number

Property Value

TypeDescription
number

The permission’s index.

|

Remarks

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

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

interval Property

Returns the text buffer interval related to the range permission.

Declaration

ts
get interval(): Interval

Property Value

TypeDescription
Interval

The text buffer interval.

|

subDocument Property

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

Declaration

ts
get subDocument(): SubDocument

Property Value

TypeDescription
SubDocument

The sub-document.

|

userName Property

Returns the name of the user with edit permission.

Declaration

ts
get userName(): string

Property Value

TypeDescription
string

The username.

|

Methods

delete Method

Deletes the range permission.

Declaration

ts
delete(): void