SetSecurity

You can use this function for Optiva Workflows and Copy Methods.

Purpose

Assigns new security values to an object.

Syntax


Dim variable As Long  = SetSecurity(Symbol,Object,OwnerSecurity,GroupSecurity,
RoleSecurity)

Arguments

Part Description
Symbol Type of object. Use empty quotation marks to indicate the symbol of the object for the workflow, or the new object for a copy method.
Object Object for which to change security. Use empty quotation marks to indicate the object for the workflow, or the new object for a copy method.
OwnerSecurity Owner security for the new object. Use empty quotation marks to leave owner security at its current value. Use these security values:
  • 0 - No access
  • 3 - Read/Copy
  • 7 - Read/Copy/Write
  • 15 - Read/Copy/Write/Delete
GroupSecurity Group security for the new object. Use empty quotation marks to leave group security at its current value. Use the same security values as OwnerSecurity.
RoleSecurity Role security for the new object. Use empty quotation marks to leave role security at its current value. Use the same security values as OwnerSecurity.

Description

SetSecurity assigns new security values to an object. This function provides more or less access to an object. For example, if a formula is in a workflow for approval, set tighter security so that users cannot change the formula.

For a raw material item with a constituent formula, specify the security at the beginning of the script. This allows for updates for the items in the constituent formula.

Examples

For formulas and specifications, you must include a backslash (\) followed by a version number.

In this example, the security for ITEMCODE is: owner privileges of 7 (read/copy/write), group privileges of 7 (read/copy/write), and role privileges of 1 (read).


Dim oItemkey As Object = ObjProperty("ITEMCODE")
Dim lSecurity As Long = SetSecurity("ITEM",oItemkey,7,7,1)

In the next example, only the security for group is changed. Use empty quotation marks ("") to keep the security that is currently defined:


Dim lSecurity As Long = SetSecurity("ITEM",oItemkey, "",7,"")