
## Protection class

Represents the various types of protection options available for a worksheet.

## Methods

| Name | Description |
| --- | --- |
| [copy(source)](#copy) | Copy protection info. |
| [getAllowDeletingColumn()](#getallowdeletingcolumn) | Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be delete |
| [getAllowDeletingRow()](#getallowdeletingrow) | Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must |
| [getAllowEditingContent()](#getalloweditingcontent) | Represents if the user is allowed to edit contents of locked cells on a protected worksheet. |
| [getAllowEditingObject()](#getalloweditingobject) | Represents if the user is allowed to manipulate drawing objects on a protected worksheet. |
| [getAllowEditingScenario()](#getalloweditingscenario) | Represents if the user is allowed to edit scenarios on a protected worksheet. |
| [getAllowFiltering()](#getallowfiltering) | Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. |
| [getAllowFormattingCell()](#getallowformattingcell) | Represents if the formatting of cells is allowed on a protected worksheet. |
| [getAllowFormattingColumn()](#getallowformattingcolumn) | Represents if the formatting of columns is allowed on a protected worksheet |
| [getAllowFormattingRow()](#getallowformattingrow) | Represents if the formatting of rows is allowed on a protected worksheet |
| [getAllowInsertingColumn()](#getallowinsertingcolumn) | Represents if the insertion of columns is allowed on a protected worksheet |
| [getAllowInsertingHyperlink()](#getallowinsertinghyperlink) | Represents if the insertion of hyperlinks is allowed on a protected worksheet |
| [getAllowInsertingRow()](#getallowinsertingrow) | Represents if the insertion of rows is allowed on a protected worksheet |
| [getAllowSelectingLockedCell()](#getallowselectinglockedcell) | Represents if the user is allowed to select locked cells on a protected worksheet. |
| [getAllowSelectingUnlockedCell()](#getallowselectingunlockedcell) | Represents if the user is allowed to select unlocked cells on a protected worksheet. |
| [getAllowSorting()](#getallowsorting) | Represents if the sorting option is allowed on a protected worksheet. |
| [getAllowUsingPivotTable()](#getallowusingpivottable) | Represents if the user is allowed to manipulate pivot tables on a protected worksheet. |
| [getPassword()](#getpassword) | Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the work |
| [getPasswordHash()](#getpasswordhash) | Gets the hash of current password. |
| [isProtectedWithPassword()](#isprotectedwithpassword) | Indicates whether the worksheets is protected with password. |
| [setAllowDeletingColumn()](#setallowdeletingcolumn) | Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be delete |
| [setAllowDeletingRow()](#setallowdeletingrow) | Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must |
| [setAllowEditingContent()](#setalloweditingcontent) | Represents if the user is allowed to edit contents of locked cells on a protected worksheet. |
| [setAllowEditingObject()](#setalloweditingobject) | Represents if the user is allowed to manipulate drawing objects on a protected worksheet. |
| [setAllowEditingScenario()](#setalloweditingscenario) | Represents if the user is allowed to edit scenarios on a protected worksheet. |
| [setAllowFiltering()](#setallowfiltering) | Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. |
| [setAllowFormattingCell()](#setallowformattingcell) | Represents if the formatting of cells is allowed on a protected worksheet. |
| [setAllowFormattingColumn()](#setallowformattingcolumn) | Represents if the formatting of columns is allowed on a protected worksheet |
| [setAllowFormattingRow()](#setallowformattingrow) | Represents if the formatting of rows is allowed on a protected worksheet |
| [setAllowInsertingColumn()](#setallowinsertingcolumn) | Represents if the insertion of columns is allowed on a protected worksheet |
| [setAllowInsertingHyperlink()](#setallowinsertinghyperlink) | Represents if the insertion of hyperlinks is allowed on a protected worksheet |
| [setAllowInsertingRow()](#setallowinsertingrow) | Represents if the insertion of rows is allowed on a protected worksheet |
| [setAllowSelectingLockedCell()](#setallowselectinglockedcell) | Represents if the user is allowed to select locked cells on a protected worksheet. |
| [setAllowSelectingUnlockedCell()](#setallowselectingunlockedcell) | Represents if the user is allowed to select unlocked cells on a protected worksheet. |
| [setAllowSorting()](#setallowsorting) | Represents if the sorting option is allowed on a protected worksheet. |
| [setAllowUsingPivotTable()](#setallowusingpivottable) | Represents if the user is allowed to manipulate pivot tables on a protected worksheet. |
| [setPassword()](#setpassword) | Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the work |
| [verifyPassword(password)](#verifypassword) | Verifies password. |

### copy(source) {#copy}

Copy protection info.

| Parameter | Type | Description |
| --- | --- | --- |
| source | Protection |  |

### getAllowDeletingColumn() {#getallowdeletingcolumn}

Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

### getAllowDeletingRow() {#getallowdeletingrow}

Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

### getAllowEditingContent() {#getalloweditingcontent}

Represents if the user is allowed to edit contents of locked cells on a protected worksheet.

### getAllowEditingObject() {#getalloweditingobject}

Represents if the user is allowed to manipulate drawing objects on a protected worksheet.

### getAllowEditingScenario() {#getalloweditingscenario}

Represents if the user is allowed to edit scenarios on a protected worksheet.

### getAllowFiltering() {#getallowfiltering}

Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

### getAllowFormattingCell() {#getallowformattingcell}

Represents if the formatting of cells is allowed on a protected worksheet.

### getAllowFormattingColumn() {#getallowformattingcolumn}

Represents if the formatting of columns is allowed on a protected worksheet

### getAllowFormattingRow() {#getallowformattingrow}

Represents if the formatting of rows is allowed on a protected worksheet

### getAllowInsertingColumn() {#getallowinsertingcolumn}

Represents if the insertion of columns is allowed on a protected worksheet

### getAllowInsertingHyperlink() {#getallowinsertinghyperlink}

Represents if the insertion of hyperlinks is allowed on a protected worksheet

### getAllowInsertingRow() {#getallowinsertingrow}

Represents if the insertion of rows is allowed on a protected worksheet

### getAllowSelectingLockedCell() {#getallowselectinglockedcell}

Represents if the user is allowed to select locked cells on a protected worksheet.

### getAllowSelectingUnlockedCell() {#getallowselectingunlockedcell}

Represents if the user is allowed to select unlocked cells on a protected worksheet.

### getAllowSorting() {#getallowsorting}

Represents if the sorting option is allowed on a protected worksheet.

### getAllowUsingPivotTable() {#getallowusingpivottable}

Represents if the user is allowed to manipulate pivot tables on a protected worksheet.

### getPassword() {#getpassword}

Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.

### getPasswordHash() {#getpasswordhash}

Gets the hash of current password.

### isProtectedWithPassword() {#isprotectedwithpassword}

Indicates whether the worksheets is protected with password.

### setAllowDeletingColumn() {#setallowdeletingcolumn}

Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

### setAllowDeletingRow() {#setallowdeletingrow}

Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

### setAllowEditingContent() {#setalloweditingcontent}

Represents if the user is allowed to edit contents of locked cells on a protected worksheet.

### setAllowEditingObject() {#setalloweditingobject}

Represents if the user is allowed to manipulate drawing objects on a protected worksheet.

### setAllowEditingScenario() {#setalloweditingscenario}

Represents if the user is allowed to edit scenarios on a protected worksheet.

### setAllowFiltering() {#setallowfiltering}

Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

### setAllowFormattingCell() {#setallowformattingcell}

Represents if the formatting of cells is allowed on a protected worksheet.

### setAllowFormattingColumn() {#setallowformattingcolumn}

Represents if the formatting of columns is allowed on a protected worksheet

### setAllowFormattingRow() {#setallowformattingrow}

Represents if the formatting of rows is allowed on a protected worksheet

### setAllowInsertingColumn() {#setallowinsertingcolumn}

Represents if the insertion of columns is allowed on a protected worksheet

### setAllowInsertingHyperlink() {#setallowinsertinghyperlink}

Represents if the insertion of hyperlinks is allowed on a protected worksheet

### setAllowInsertingRow() {#setallowinsertingrow}

Represents if the insertion of rows is allowed on a protected worksheet

### setAllowSelectingLockedCell() {#setallowselectinglockedcell}

Represents if the user is allowed to select locked cells on a protected worksheet.

### setAllowSelectingUnlockedCell() {#setallowselectingunlockedcell}

Represents if the user is allowed to select unlocked cells on a protected worksheet.

### setAllowSorting() {#setallowsorting}

Represents if the sorting option is allowed on a protected worksheet.

### setAllowUsingPivotTable() {#setallowusingpivottable}

Represents if the user is allowed to manipulate pivot tables on a protected worksheet.

### setPassword() {#setpassword}

Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.

### verifyPassword(password) {#verifypassword}

Verifies password.

| Parameter | Type | Description |
| --- | --- | --- |
| password | String | The password. |

**Returns:** boolean — `boolean`
