aspose.cells
Class Protection

Represents the various types of protection options available for a worksheet. Only used in ExcelXP and above version.

Example:

$workbook = new cells\Workbook();
$worksheet = $workbook->getWorksheets()->get(0);
$worksheet->getProtection()->setAllowSelectingLockedCell(false);
//Allowing users to select unlocked cells of the worksheet
$worksheet->getProtection()->setAllowSelectingUnlockedCell(true);

Property Getters/Setters Summary
functiongetAllowDeletingColumn()
functionsetAllowDeletingColumn(value)
           Represents if the deletion of columns is allowed on a protected worksheet.
functiongetAllowDeletingRow()
functionsetAllowDeletingRow(value)
           Represents if the deletion of rows is allowed on a protected worksheet.
functiongetAllowEditingContent()
functionsetAllowEditingContent(value)
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
functiongetAllowEditingObject()
functionsetAllowEditingObject(value)
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
functiongetAllowEditingScenario()
functionsetAllowEditingScenario(value)
           Represents if the user is allowed to edit scenarios on a protected worksheet.
functiongetAllowFiltering()
functionsetAllowFiltering(value)
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
functiongetAllowFormattingCell()
functionsetAllowFormattingCell(value)
           Represents if the formatting of cells is allowed on a protected worksheet.
functiongetAllowFormattingColumn()
functionsetAllowFormattingColumn(value)
           Represents if the formatting of columns is allowed on a protected worksheet
functiongetAllowFormattingRow()
functionsetAllowFormattingRow(value)
           Represents if the formatting of rows is allowed on a protected worksheet
functiongetAllowInsertingColumn()
functionsetAllowInsertingColumn(value)
           Represents if the insertion of columns is allowed on a protected worksheet
functiongetAllowInsertingHyperlink()
functionsetAllowInsertingHyperlink(value)
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
functiongetAllowInsertingRow()
functionsetAllowInsertingRow(value)
           Represents if the insertion of rows is allowed on a protected worksheet
functiongetAllowSelectingLockedCell()
functionsetAllowSelectingLockedCell(value)
           Represents if the user is allowed to select locked cells on a protected worksheet.
functiongetAllowSelectingUnlockedCell()
functionsetAllowSelectingUnlockedCell(value)
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
functiongetAllowSorting()
functionsetAllowSorting(value)
           Represents if the sorting option is allowed on a protected worksheet.
functiongetAllowUsingPivotTable()
functionsetAllowUsingPivotTable(value)
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
functionisDeletingColumnsAllowed()
functionsetDeletingColumnsAllowed(value)
           Represents if the deletion of columns is allowed on a protected worksheet.
functionisDeletingRowsAllowed()
functionsetDeletingRowsAllowed(value)
           Represents if the deletion of rows is allowed on a protected worksheet.
functionisEditingContentsAllowed()
functionsetEditingContentsAllowed(value)
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
functionisEditingObjectsAllowed()
functionsetEditingObjectsAllowed(value)
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
functionisEditingScenariosAllowed()
functionsetEditingScenariosAllowed(value)
           Represents if the user is allowed to edit scenarios on a protected worksheet.
functionisFilteringAllowed()
functionsetFilteringAllowed(value)
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
functionisFormattingCellsAllowed()
functionsetFormattingCellsAllowed(value)
           Represents if the formatting of cells is allowed on a protected worksheet.
functionisFormattingColumnsAllowed()
functionsetFormattingColumnsAllowed(value)
           Represents if the formatting of columns is allowed on a protected worksheet
functionisFormattingRowsAllowed()
functionsetFormattingRowsAllowed(value)
           Represents if the formatting of rows is allowed on a protected worksheet
functionisInsertingColumnsAllowed()
functionsetInsertingColumnsAllowed(value)
           Represents if the insertion of columns is allowed on a protected worksheet
functionisInsertingHyperlinksAllowed()
functionsetInsertingHyperlinksAllowed(value)
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
functionisInsertingRowsAllowed()
functionsetInsertingRowsAllowed(value)
           Represents if the insertion of rows is allowed on a protected worksheet
functionisProtectedWithPassword()
           Indicates whether the worksheets is protected with password.
functionisSelectingLockedCellsAllowed()
functionsetSelectingLockedCellsAllowed(value)
           Represents if the user is allowed to select locked cells on a protected worksheet.
functionisSelectingUnlockedCellsAllowed()
functionsetSelectingUnlockedCellsAllowed(value)
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
functionisSortingAllowed()
functionsetSortingAllowed(value)
           Represents if the sorting option is allowed on a protected worksheet.
functionisUsingPivotTablesAllowed()
functionsetUsingPivotTablesAllowed(value)
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
functiongetPassword()
functionsetPassword(value)
           Represents the password to protect the worksheet.
 
Method Summary
functioncopy(source)
           Copy protection info.
functiongetPasswordHash()
           Gets the hash of current password.
functionverifyPassword(password)
           Verifies password.
 

Property Getters/Setters Detail

getAllowDeletingColumn/setAllowDeletingColumn : boolean 

function getAllowDeletingColumn() / function setAllowDeletingColumn(value)
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.

isDeletingColumnsAllowed/setDeletingColumnsAllowed : boolean 

function isDeletingColumnsAllowed() / function setDeletingColumnsAllowed(value)
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. NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowDeletingRow/setAllowDeletingRow : boolean 

function getAllowDeletingRow() / function setAllowDeletingRow(value)
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.

isDeletingRowsAllowed/setDeletingRowsAllowed : boolean 

function isDeletingRowsAllowed() / function setDeletingRowsAllowed(value)
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. NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFiltering/setAllowFiltering : boolean 

function getAllowFiltering() / function setAllowFiltering(value)
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

isFilteringAllowed/setFilteringAllowed : boolean 

function isFilteringAllowed() / function setFilteringAllowed(value)
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. NOTE: This member is now obsolete. Instead, please use Protection.AllowFiltering property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingCell/setAllowFormattingCell : boolean 

function getAllowFormattingCell() / function setAllowFormattingCell(value)
Represents if the formatting of cells is allowed on a protected worksheet.

isFormattingCellsAllowed/setFormattingCellsAllowed : boolean 

function isFormattingCellsAllowed() / function setFormattingCellsAllowed(value)
Represents if the formatting of cells is allowed on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingColumn/setAllowFormattingColumn : boolean 

function getAllowFormattingColumn() / function setAllowFormattingColumn(value)
Represents if the formatting of columns is allowed on a protected worksheet

isFormattingColumnsAllowed/setFormattingColumnsAllowed : boolean 

function isFormattingColumnsAllowed() / function setFormattingColumnsAllowed(value)
Represents if the formatting of columns is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingRow/setAllowFormattingRow : boolean 

function getAllowFormattingRow() / function setAllowFormattingRow(value)
Represents if the formatting of rows is allowed on a protected worksheet

isFormattingRowsAllowed/setFormattingRowsAllowed : boolean 

function isFormattingRowsAllowed() / function setFormattingRowsAllowed(value)
Represents if the formatting of rows is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingColumn/setAllowInsertingColumn : boolean 

function getAllowInsertingColumn() / function setAllowInsertingColumn(value)
Represents if the insertion of columns is allowed on a protected worksheet

isInsertingColumnsAllowed/setInsertingColumnsAllowed : boolean 

function isInsertingColumnsAllowed() / function setInsertingColumnsAllowed(value)
Represents if the insertion of columns is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingHyperlink/setAllowInsertingHyperlink : boolean 

function getAllowInsertingHyperlink() / function setAllowInsertingHyperlink(value)
Represents if the insertion of hyperlinks is allowed on a protected worksheet

isInsertingHyperlinksAllowed/setInsertingHyperlinksAllowed : boolean 

function isInsertingHyperlinksAllowed() / function setInsertingHyperlinksAllowed(value)
Represents if the insertion of hyperlinks is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingHyperlink property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingRow/setAllowInsertingRow : boolean 

function getAllowInsertingRow() / function setAllowInsertingRow(value)
Represents if the insertion of rows is allowed on a protected worksheet

isInsertingRowsAllowed/setInsertingRowsAllowed : boolean 

function isInsertingRowsAllowed() / function setInsertingRowsAllowed(value)
Represents if the insertion of rows is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowSorting/setAllowSorting : boolean 

function getAllowSorting() / function setAllowSorting(value)
Represents if the sorting option is allowed on a protected worksheet.

isSortingAllowed/setSortingAllowed : boolean 

function isSortingAllowed() / function setSortingAllowed(value)
Represents if the sorting option is allowed on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSorting property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowUsingPivotTable/setAllowUsingPivotTable : boolean 

function getAllowUsingPivotTable() / function setAllowUsingPivotTable(value)
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.

isUsingPivotTablesAllowed/setUsingPivotTablesAllowed : boolean 

function isUsingPivotTablesAllowed() / function setUsingPivotTablesAllowed(value)
Represents if the user is allowed to manipulate pivot tables on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowUsingPivotTable property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingContent/setAllowEditingContent : boolean 

function getAllowEditingContent() / function setAllowEditingContent(value)
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.

isEditingContentsAllowed/setEditingContentsAllowed : boolean 

function isEditingContentsAllowed() / function setEditingContentsAllowed(value)
Represents if the user is allowed to edit contents of locked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingContent property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingObject/setAllowEditingObject : boolean 

function getAllowEditingObject() / function setAllowEditingObject(value)
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.

isEditingObjectsAllowed/setEditingObjectsAllowed : boolean 

function isEditingObjectsAllowed() / function setEditingObjectsAllowed(value)
Represents if the user is allowed to manipulate drawing objects on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingObject property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingScenario/setAllowEditingScenario : boolean 

function getAllowEditingScenario() / function setAllowEditingScenario(value)
Represents if the user is allowed to edit scenarios on a protected worksheet.

isEditingScenariosAllowed/setEditingScenariosAllowed : boolean 

function isEditingScenariosAllowed() / function setEditingScenariosAllowed(value)
Represents if the user is allowed to edit scenarios on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingScenario property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getPassword/setPassword : String 

function getPassword() / function setPassword(value)
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.

isProtectedWithPassword : boolean 

function isProtectedWithPassword()
Indicates whether the worksheets is protected with password.

getAllowSelectingLockedCell/setAllowSelectingLockedCell : boolean 

function getAllowSelectingLockedCell() / function setAllowSelectingLockedCell(value)
Represents if the user is allowed to select locked cells on a protected worksheet.

isSelectingLockedCellsAllowed/setSelectingLockedCellsAllowed : boolean 

function isSelectingLockedCellsAllowed() / function setSelectingLockedCellsAllowed(value)
Represents if the user is allowed to select locked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingLockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowSelectingUnlockedCell/setAllowSelectingUnlockedCell : boolean 

function getAllowSelectingUnlockedCell() / function setAllowSelectingUnlockedCell(value)
Represents if the user is allowed to select unlocked cells on a protected worksheet.

isSelectingUnlockedCellsAllowed/setSelectingUnlockedCellsAllowed : boolean 

function isSelectingUnlockedCellsAllowed() / function setSelectingUnlockedCellsAllowed(value)
Represents if the user is allowed to select unlocked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingUnlockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

Method Detail

copy

function copy(source)
Copy protection info.
Parameters:
source: Protection -

getPasswordHash

function getPasswordHash()
Gets the hash of current password.

verifyPassword

function verifyPassword(password)
Verifies password.
Parameters:
password: String - The password.
Returns:

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.