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
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
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
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
get subDocument(): SubDocument
Property Value
Type | Description |
---|---|
SubDocument | The sub-document. |
userName Property
Returns the name of the user with edit permission.
Declaration
get userName(): string
Property Value
Type | Description |
---|---|
string | The username. |
Methods
delete Method
Deletes the range permission.
Declaration
delete(): void