SetSecurityACL
You can use this function for Optiva Workflows, Copy Methods, and Equations.
Purpose
The function SetSecurityACL assigns security values to Optiva objects and users through an Access Control List.
Syntax
int SetSecurityACL(string objSymbol, string objKey, string dtlCode, string typeCode, string typeKey, int accessSecurity)
Return Value
If the code is successful a value zero (0) is displayed and minus one (-1) if there is an error.
Arguments
| Part | Description |
|---|---|
ObjSymbol |
The object type or current object type of the data.
Note: Use empty quotation marks to indicate the current symbol of the workflow.
|
objkey |
The object key or the current object key of the data.
Note: Use empty quotation marks to indicate the current object of the workflow.
|
dtlCode |
The Detail code of the tab/section in an Optiva object for which security permissions need to be applied. Use '@' to indicate all detail codes of the object. |
TypeCode |
The hierarchy to which security is to be set must be specified, like USER, GROUP, ROLE. |
TypeKey |
The user code. Eg., FSI for USER / RL_ADMIN for ROLE / ADMINISTRATION for GROUP. |
Security |
The standard system security values which are to be set to Optiva objects and users. Use these security values:
|
Description
This function returns 0 if successful, -1 if there is an error.
Examples
This example creates an ACL for the FSI user for the current object. The Document detail can be viewed but not updated or deleted.
Dim rc As Integer = SetSecurityACL("DOC", "USER", "FSI", 3)
This example removes any existing ACL from the current object in context for the RL_ADMIN role and the INGR detail code.
Dim rc As Integer = SetSecurityACL("INGR", "ROLE", "RL_ADMIN", -1)
This example creates an ACL that allows all users read access to the CUSTOM detail for the ITEM object with the key “01001”.
Dim rc As Integer = SetSecurityACL("ITEM", "01001", "CUSTOM", "USER",
"@DFLT", 3)
Example 1: This example determines to set Read/Copy access (3) to the CONTEXT detail code of the item "01001" specifically for the user identified by "FSI"
SetSecurityACL("ITEM", "01001", "CONTEXT", "USER", "FSI", 3);
CONTEXT detail code is for Context attributes tab.
Example 2: This example determines to set Read/Copy access (3) to the all detail codes of the item "01001" specifically for the user identified by "FSI"
SetSecurityACL("ITEM", "01001", "@", "USER", "FSI", 3);
CONTEXT detail code is for Context attributes tab.
Example 3: This example removes any existing ACL on INGR(Formula Ingredients/Item lines tab) from the current object for the RL_ADMIN role.
SetSecurityACL("", "", "INGR", "ROLE", "RL_ADMIN", -1);
Example 4: This example grants Read/Copy/Write (security level 7) access on the "TPALL"(Parameters tab) of the object "SEMISECRET" for the role "RL_ADMIN"
SetSecurityACL("", "SEMISECRET", "TPALL", "ROLE", "RL_ADMIN", 7);