integerIsIn Function Description

Description

Returns true if the value of the first parameter is in the bag of values of the second parameter. Attributes of type integer are compared using the integerEqual function.

integerIsIn belongs to the ALFA function reference's Bag functions category. It maps to the XACML function identifier urn:oasis:names:tc:xacml:1.0:function:integer-is-in, takes 2 arguments and returns a value of type boolean.

Property Value
Category Bag functions
# Arguments 2
Arguments
  • atomic (single) value of type integer
  • bag (collection) of values of type integer
Return Value boolean
Expressed As pre-fix
Representation ALFA short name
Allowed In Target true
ALFA Shorthand None
Commutative false

Example

/**
* Permit if the integer pickedNumber in the list of lucky numbers (integer). Note here the
* use of the function inside a condition as it is used to compare 2 attributes.
*/
rule integerIsInExample{
    condition integerIsIn(integerOneAndOnly(pickedNumber), luckyNumbers)
    permit
}

Permit if the value passed as the first parameter is in the bag of values passed as the second parameter