aspose.cells

Class Protection

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

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()
function
           Represents if the deletion of columns is allowed on a protected worksheet.
functiongetAllowDeletingRow()
function
           Represents if the deletion of rows is allowed on a protected worksheet.
functiongetAllowEditingContent()
function
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
functiongetAllowEditingObject()
function
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
functiongetAllowEditingScenario()
function
           Represents if the user is allowed to edit scenarios on a protected worksheet.
functiongetAllowFiltering()
function
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
functiongetAllowFormattingCell()
function
           Represents if the formatting of cells is allowed on a protected worksheet.
functiongetAllowFormattingColumn()
function
           Represents if the formatting of columns is allowed on a protected worksheet
functiongetAllowFormattingRow()
function
           Represents if the formatting of rows is allowed on a protected worksheet
functiongetAllowInsertingColumn()
function
           Represents if the insertion of columns is allowed on a protected worksheet
functiongetAllowInsertingHyperlink()
function
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
functiongetAllowInsertingRow()
function
           Represents if the insertion of rows is allowed on a protected worksheet
functiongetAllowSelectingLockedCell()
function
           Represents if the user is allowed to select locked cells on a protected worksheet.
functiongetAllowSelectingUnlockedCell()
function
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
functiongetAllowSorting()
function
           Represents if the sorting option is allowed on a protected worksheet.
functiongetAllowUsingPivotTable()
function
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
functionisProtectedWithPassword()
Indicates whether the worksheets is protected with password.
functiongetPassword()
function
           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.
      • 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.
      • 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.
      • getAllowFormattingCell/setAllowFormattingCell : boolean 

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

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

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

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

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

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

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

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

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

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

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

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

        function getAllowSelectingUnlockedCell() / function setAllowSelectingUnlockedCell(value)
        
        Represents if the user is allowed to select unlocked cells on a protected worksheet.
      • 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.
    • Method Detail

      • copy

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

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

        function getPasswordHash()
        Gets the hash of current password.