Skip to main content
Version: 8.1

containsAll

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 all of the listed elements are present in the collection object. The function requires at least two arguments, a collection and an element.

Syntax​

containsAll(collection, element0, [elementN])

  • Parameters

    • 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.

  • Results

    • Boolean - True if the collection object contained all of the listed elements; false if otherwise.

Examples​

Code Snippet
// Returns true for a login attempt against an Ignition IdP, if the user has both Administrator and Operator roles.
containsAll({attribute-source:idTokenClaims:roles}, 'Administrator', 'Operator')
Code Snippet
// Returns true for a login attempt if the login location is in all three of the specified security zones.
containsAll({security-zones}, 'site 1', 'mill', 'offshore')