(ORG-8018)
Project Protection and Admin Mode
Table of Contents | ||
---|---|---|
|
LabTalk commands to enable various protections on worksheets and workbooks have been introduced in Origin 9.1. Further modemore, Admin mode has been introduced to allow better protection controls on Origin projects. You may control protection attributes of Origin object (like a book) without involving Admin mode, but such protection is not secured, anyone can run LabTalk command to remove these protections. To ensure secured protection, you must setup Admin password for the Origin project and then Origin Object protections cannot be altered until the correct password is entered. Very often, security is not an issue and you may just want to prevent inadvertent or accidental modification or delete of certain book or sheet, and in such situation, you may add protection without Admin password, which certainly make things easier, not having to remember a password on given OPJ.
...
Hex Value | Description |
---|---|
2 | Data: This include all the cells in a worksheet, data cells or label cells |
4 | Style: Display style, like the color of the cell, or the cell formatting, this is currently not yet fully implemented |
10 | Formula: Column Formula, Analysis Operation, Codes attached to Project etc. (Not Ready) |
80 | Structure: This include like the number of rows and columns in a worksheet. inserting, deleting etc. Keep the columns in the sheet unchanged, prevent insert/delete columns or moving columns, but still allow rows to be changed. |
100 | Rename: For sheet, to prevent user to change a sheet's name |
400 | Delete: Prevent the object from being deleted |
...
You can use the following labtalk commands to look lock a sheet of a book. If Admin password has not been set, these commands will work fine. Once Admin password is set, then you must login first before using these commands.
...
Command | Description | Examples | |||
---|---|---|---|---|---|
| set worksheet write access flags |
| |||
layer -lt | print out current protection flags | ||||
page -lw n | set workbook write access flags | //the following will prepare the book for locking active sheet but allow analysis results added to book
| page -lt | print out the current protection flags | //other examples
|
page -lt | print out the current protection flags |
Exclusion Zones on Read-Only Sheet
...
Please note that you can only make Exclusion Zone modification when the sheet is unprotected. So to set the sheet up as a form, you should first add all the needed Exclusion Zones, then protect the sheet from medication modification with lay -lw hex(82);
for example.
...
The following is a listing of the currently supported doc commands control the Admin mode. Text inside square brackets indicateis optional.
...
Command | Description | Examples |
---|---|---|
| Add Admin password password to the project. You will still need to login after adding password to turn on Admin mode. When you do not specify a password, then "origin" is assumed. Not using password will help situation where security is not so much of a concern and not running the risk of forgetting the password used. |
|
doc -pw [password] | login with password, if no Admin password added yet, error message will be shown | doc -pw; doc -pw test; |
doc -pwx | logout, once logout, cannot change anything related to protections | |
doc -pwta | list all the book/sheets with protection turned on | |
doc -pwr [password] | remove password, if no password specified, then must login first to do so, otherwise must give correct password | doc -pwr; |
...