SetSecurityACL

You can use the SetSecurityACL function to assign security values to Optiva objects and users through an Access Control List.

When to use

You can use this function:

  • To grant specific users access to certain tabs only.
  • To remove previously granted ACL access.

When not to use

You cannot use this function:

  • For simple object-level security. Use SetSecurity instead.
  • With objects that do not support ACL.

Syntax

int SetSecurityACL(string objSymbol, string objKey, string dtlCode, string typeCode, string typeKey, int accessSecurity) 

Parameters

Parameter Type Required Description
objSymbol string Yes

The symbol of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
objectKey string Yes

The key of the object.

Note: You can use empty quotation marks ("") for the current workflow symbol.
dtlCode string Yes The Detail code of the tab or section in an Optiva object for which security permissions need to be applied.
Note:  You can use '@' to indicate all detail codes of the object.
typeCode string Yes Specify the hierarchy to which security is to be set. SUch as USER, GROUP, ROLE.
typeKey string Yes Code identifying the specific user, group, or role. For example, "FSI" for user, "RL_ADMIN" for role, "ADMINISTRATION" for group.
accessSecurity int Yes Standard system security values which is to be set to Optiva objects and users. Possible security values:
  • 0- No permissions.
  • 3- user can view and copy the object.
  • 7- user can view, copy, and modify the object.
  • 15- use can read, copy, write or delete.
  • "" (empty string)- leaves the security settings unchanged.
  • -1- Removes existing permission.

Return Value

The application returns a value zero (0) if the operation is successful and -1 if an error occurs.

Impact

  • The ACL entries in the database are created or modified.
  • The changes immediately affect the specified users, groups, or roles.
  • May grant or restrict access to specific object sections.

Prerequisites

  • The detail codes must be valid for the object type.
  • The type codes must be valid. Possible values are USER, GROUP, and ROLE.
  • The function does not override the users basic role or object security permissions. If the users access to a form does not exceed 3, setting the value to 7 does not grant write access.

Example

Example 1
Set ACL Security for a specific dtlCode.
SetSecurityACL("ITEM", "01001", "CONTEXT", "USER", "FSI", 3);
Description

This example determines to set Read or Copy access (3) to the "CONTEXT" detail code of the item "01001" specifically for the user identified by "FSI".

Note: The CONTEXT detail code is for Context attributes tab.
Example 2
Set ACL Security for all dtlCodes.
SetSecurityACL("ITEM", "01001", "@", "USER", "FSI", 3);
Description

This example determines to set Read or Copy access (3) to the all detail codes of the item "01001" specifically for the user identified by "FSI".

Example 3
Remove ACL Security on INGR dtlCode for current object.
SetSecurityACL("", "", "INGR", "ROLE", "RL_ADMIN", -1);
Description
This example removes any existing ACL on INGR(Formula Ingredients Item lines tab) from the current object for the RL_ADMIN role.
Example 4
Set ACL Security on TPALL for current object of the workflow.
SetSecurityACL("", "SEMISECRET", "TPALL", "ROLE", "RL_ADMIN", 7);
Description
This example grants Read/Copy/Write (security level 7) access on the "TPALL"(Parameters tab) of the object "SEMISECRET" for the role "RL_ADMIN".