allOfAny 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 first bag and any element of the second bag.
allOfAny 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:all-of-any, takes 3 arguments and returns a value of type boolean.
| Property | Value |
|---|---|
| Category | higher order bag functions |
| # Arguments | 3 |
| Arguments |
|
| 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 allOfAnyExample{
permit
condition allOfAny(function[stringEqual], vehicleRequirements, userQualifications)
}
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: