containsAny
This function is used by Ignition's Expression language.
Description​
note
This function is only available for Security Level Rules and User Attribute Mapping.
This function checks to see if any of the listed elements are present in the collection object. The function requires at least two arguments, a collection
and an element
.
Syntax​
containsAny(collection, element0, [elementN])
Parameters​
Type | Parameter | Description |
---|---|---|
Object | collection | A collection of values. Typically from the {security-zone} object or the {idp-attribute:X} object. |
String | element | One or more comma-separated elements to look for in the collection. |
Returns​
Boolean - Returns true if the collection contains any of the listed elements, or false otherwise.
Examples​
Code Snippet
// Returns true for a login attempt against an Ignition IdP, if the user has either the Administrator or Operator roles.
containsAny({attribute-source:idTokenClaims:roles}, 'Administrator', 'Operator')
Code Snippet
// Returns true for a login attempt if the login location is in at least one of the specified security zones.
containsAny({security-zones}, 'site 1', 'mill', 'offshore')