anyOfAll Function Description

Description

This function applies a Boolean function between the elements of two bags. The expression SHALL be “True” if and only if the supplied predicate is “True” between each element of the second bag and any element of the first bag. This function is exactly the same as allOfAny with the 2nd and 3rd parameters inverted.

anyOfAll belongs to the ALFA function reference's higher order bag functions category. It maps to the XACML function identifier urn:oasis:names:tc:xacml:1.0:function:any-of-all, takes 3 arguments and returns a value of type boolean.

Property Value
Category higher order bag functions
# Arguments 3
Arguments
  • function(2 arguments of primitive types): boolean,
  • 1 bag,
  • 1 bag
Return Value boolean
Expressed As pre-fix
Representation ALFA short name
Allowed In Target false
ALFA Shorthand None
Commutative false

Example

/**
 * Driver's test: this rule checks that a user has all the necessary
 * qualifications in order to drive a vehicle. All of the values inside
 * the vehicleRequirements must be inside the userQualifications bag.
 * A user can have more qualifications though and access should still
 * be granted so long as the user has all the requirements inside
 * vehicleRequirements.
 */            
rule anyOfAllExample{
    permit
    condition anyOfAll(function[stringEqual], userQualifications, vehicleRequirements)

}

This example implements the driver's test use case. The rule checks that a user has all the necessary qualifications in order to drive a vehicle. All of the values inside the vehicleRequirements must be inside the userQualifications bag. A user can have more qualifications though and access should still be granted so long as the user has all the requirements inside vehicleRequirements.

Related Functions

Other functions in the higher order bag functions category:

Browse the full ALFA function reference.