asposecells.api

Class Protection

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

Example:

# Instantiating a Workbook object
workbook = Workbook()
# Adding a new worksheet to the Excel object
sheetIndex = workbook.getWorksheets().add()
worksheet = workbook.getWorksheets().get(sheetIndex)
# Allowing users to select locked cells of the worksheet
worksheet.getProtection().setAllowSelectingLockedCell(True)
# Allowing users to select unlocked cells of the worksheet
worksheet.getProtection().setAllowSelectingUnlockedCell(True)

Property Getters/Setters Summary
methodgetAllowDeletingColumn()
method
           Represents if the deletion of columns is allowed on a protected worksheet.
methodgetAllowDeletingRow()
method
           Represents if the deletion of rows is allowed on a protected worksheet.
methodgetAllowEditingContent()
method
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
methodgetAllowEditingObject()
method
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
methodgetAllowEditingScenario()
method
           Represents if the user is allowed to edit scenarios on a protected worksheet.
methodgetAllowFiltering()
method
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
methodgetAllowFormattingCell()
method
           Represents if the formatting of cells is allowed on a protected worksheet.
methodgetAllowFormattingColumn()
method
           Represents if the formatting of columns is allowed on a protected worksheet
methodgetAllowFormattingRow()
method
           Represents if the formatting of rows is allowed on a protected worksheet
methodgetAllowInsertingColumn()
method
           Represents if the insertion of columns is allowed on a protected worksheet
methodgetAllowInsertingHyperlink()
method
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
methodgetAllowInsertingRow()
method
           Represents if the insertion of rows is allowed on a protected worksheet
methodgetAllowSelectingLockedCell()
method
           Represents if the user is allowed to select locked cells on a protected worksheet.
methodgetAllowSelectingUnlockedCell()
method
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
methodgetAllowSorting()
method
           Represents if the sorting option is allowed on a protected worksheet.
methodgetAllowUsingPivotTable()
method
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
methodisDeletingColumnsAllowed()
method
           Represents if the deletion of columns is allowed on a protected worksheet.
methodisDeletingRowsAllowed()
method
           Represents if the deletion of rows is allowed on a protected worksheet.
methodisEditingContentsAllowed()
method
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
methodisEditingObjectsAllowed()
method
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
methodisEditingScenariosAllowed()
method
           Represents if the user is allowed to edit scenarios on a protected worksheet.
methodisFilteringAllowed()
method
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
methodisFormattingCellsAllowed()
method
           Represents if the formatting of cells is allowed on a protected worksheet.
methodisFormattingColumnsAllowed()
method
           Represents if the formatting of columns is allowed on a protected worksheet
methodisFormattingRowsAllowed()
method
           Represents if the formatting of rows is allowed on a protected worksheet
methodisInsertingColumnsAllowed()
method
           Represents if the insertion of columns is allowed on a protected worksheet
methodisInsertingHyperlinksAllowed()
method
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
methodisInsertingRowsAllowed()
method
           Represents if the insertion of rows is allowed on a protected worksheet
methodisProtectedWithPassword()
Indicates whether the worksheets is protected with password.
methodisSelectingLockedCellsAllowed()
method
           Represents if the user is allowed to select locked cells on a protected worksheet.
methodisSelectingUnlockedCellsAllowed()
method
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
methodisSortingAllowed()
method
           Represents if the sorting option is allowed on a protected worksheet.
methodisUsingPivotTablesAllowed()
method
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
methodgetPassword()
method
           Represents the password to protect the worksheet.
 
Method Summary
methodcopy(source)
Copy protection info.
methodgetPasswordHash()
Gets the hash of current password.
methodverifyPassword(password)
Verifies password.
 

    • Property Getters/Setters Detail

      • getAllowDeletingColumn/setAllowDeletingColumn : boolean 

        boolean getAllowDeletingColumn() / 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 

        boolean isDeletingColumnsAllowed() / 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 

        boolean getAllowDeletingRow() / 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 

        boolean isDeletingRowsAllowed() / 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 

        boolean getAllowFiltering() / 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 

        boolean isFilteringAllowed() / 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 

        boolean getAllowFormattingCell() / setAllowFormattingCell(value)
        
        Represents if the formatting of cells is allowed on a protected worksheet.
      • isFormattingCellsAllowed/setFormattingCellsAllowed : boolean 

        boolean isFormattingCellsAllowed() / 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 

        boolean getAllowFormattingColumn() / setAllowFormattingColumn(value)
        
        Represents if the formatting of columns is allowed on a protected worksheet
      • isFormattingColumnsAllowed/setFormattingColumnsAllowed : boolean 

        boolean isFormattingColumnsAllowed() / 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 

        boolean getAllowFormattingRow() / setAllowFormattingRow(value)
        
        Represents if the formatting of rows is allowed on a protected worksheet
      • isFormattingRowsAllowed/setFormattingRowsAllowed : boolean 

        boolean isFormattingRowsAllowed() / 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 

        boolean getAllowInsertingColumn() / setAllowInsertingColumn(value)
        
        Represents if the insertion of columns is allowed on a protected worksheet
      • isInsertingColumnsAllowed/setInsertingColumnsAllowed : boolean 

        boolean isInsertingColumnsAllowed() / 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 

        boolean getAllowInsertingHyperlink() / setAllowInsertingHyperlink(value)
        
        Represents if the insertion of hyperlinks is allowed on a protected worksheet
      • isInsertingHyperlinksAllowed/setInsertingHyperlinksAllowed : boolean 

        boolean isInsertingHyperlinksAllowed() / 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 

        boolean getAllowInsertingRow() / setAllowInsertingRow(value)
        
        Represents if the insertion of rows is allowed on a protected worksheet
      • isInsertingRowsAllowed/setInsertingRowsAllowed : boolean 

        boolean isInsertingRowsAllowed() / 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 

        boolean getAllowSorting() / setAllowSorting(value)
        
        Represents if the sorting option is allowed on a protected worksheet.
      • isSortingAllowed/setSortingAllowed : boolean 

        boolean isSortingAllowed() / 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 

        boolean getAllowUsingPivotTable() / setAllowUsingPivotTable(value)
        
        Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
      • isUsingPivotTablesAllowed/setUsingPivotTablesAllowed : boolean 

        boolean isUsingPivotTablesAllowed() / 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 

        boolean getAllowEditingContent() / setAllowEditingContent(value)
        
        Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
      • isEditingContentsAllowed/setEditingContentsAllowed : boolean 

        boolean isEditingContentsAllowed() / 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 

        boolean getAllowEditingObject() / setAllowEditingObject(value)
        
        Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
      • isEditingObjectsAllowed/setEditingObjectsAllowed : boolean 

        boolean isEditingObjectsAllowed() / 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 

        boolean getAllowEditingScenario() / setAllowEditingScenario(value)
        
        Represents if the user is allowed to edit scenarios on a protected worksheet.
      • isEditingScenariosAllowed/setEditingScenariosAllowed : boolean 

        boolean isEditingScenariosAllowed() / 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 

        String getPassword() / 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 

        boolean isProtectedWithPassword()
        
        Indicates whether the worksheets is protected with password.
      • getAllowSelectingLockedCell/setAllowSelectingLockedCell : boolean 

        boolean getAllowSelectingLockedCell() / setAllowSelectingLockedCell(value)
        
        Represents if the user is allowed to select locked cells on a protected worksheet.
      • isSelectingLockedCellsAllowed/setSelectingLockedCellsAllowed : boolean 

        boolean isSelectingLockedCellsAllowed() / 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 

        boolean getAllowSelectingUnlockedCell() / setAllowSelectingUnlockedCell(value)
        
        Represents if the user is allowed to select unlocked cells on a protected worksheet.
      • isSelectingUnlockedCellsAllowed/setSelectingUnlockedCellsAllowed : boolean 

        boolean isSelectingUnlockedCellsAllowed() / 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

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

        int getPasswordHash()
        Gets the hash of current password.
      • verifyPassword

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