Skip to main content

array

Vasyl MartyniukLess than 1 minute

Syntax

(*array)${...}
(*array)[...]

Examples

  • (*array)${USER.roles} - prepare an array of user roles
  • (*array)['apple','banana','onion'] - prepare an array of strings

Definition

Treat returned by a marker value as an array of scalar values. If typecasting value is a string, then treat it as a JSON array and try to decode it with json_decodeopen in new window PHP function. It is a very useful typecast for conditions where values inject dynamically with markers.

For example, the following condition receives an array of values from the callback function GetAdminEmails and grants the current user the "Administrator" role if a match found.

{
    "Statement": {
        "Effect": "allow",
        "Resource": [
            "Role:administrator"
        ],
        "Condition": {
            "In": {
                "${USER.user_email}": "(*array)${CALLBACK.GetAdminEmails}"
            }
        }
    }
}