SetSecurityACL

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

Purpose

Assigns security values to objects and users through an Access Control List.

Syntax


Dim variable As Integer = SetSecurityAcl([Symbol], [Object] detailCode, typeCode, TypeKey, AccessSecurity)

Arguments

Part Description
Symbol Optional Type of object symbol supporting ACL: Formula, Item, Project.

Omit to indicate the symbol of the current object for a workflow, copy method, or equation.

Object Optional. The code to the object. For formulas, use code\version. Omit to indicate the current object for the workflow, copy method or equation.
DetailCode Object details, such as:
  • INGR - ingredients
  • TP0 - rollup parameters
  • DOC - attached documents

Use '@' as a wildcard to indicate the security settings that apply to any detail code that is not specifically defined. For a description of detail codes, see ObjProperty.

TypeCode USER, GROUP, ROLE. This argument is compatible with refObj in previous versions of Optiva.
TypeKey The code of the User, Group or Role, such as FSI for USER or RL_ADMIN for ROLE. This argument is compatible with refCode in previous versions of Optiva.
Security Standard system security. Use these security values:
  • 1 - Delete an existing ACL entry
  • 0 - No access
  • 3 - Read/Copy
  • 7 - Read/Copy/Write
  • 15 - Read/Copy/Write/Delete

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)