andFunction Function Description

Description

This function SHALL return "True" if it has no arguments and SHALL return "False" if one of its arguments evaluates to "False". The order of evaluation SHALL be from first argument to last. The evaluation SHALL stop with a result of "False" if any argument evaluates to "False", leaving the rest of the arguments unevaluated.

andFunction belongs to the ALFA function reference's logical functions category. It maps to the XACML function identifier urn:oasis:names:tc:xacml:1.0:function:and, takes n arguments and returns a value of type boolean.

Property Value
Category logical functions
# Arguments n
Arguments
  • n boolean values
Return Value boolean
Expressed As in-fix and pre-fix
Representation Either of: - a and b (Target) - a && b (Condition) - andFunction(a, b) (Condition)
Allowed In Target true
ALFA Shorthand && (condition) or and (target)
Commutative true

Example

/**
 * In this example, the condition will be true if (a) isActive contains a single value
 * and (b) isOver18 is single-valued and both values are true.
 */
rule andFunctionExample{
    permit
    condition andFunction(booleanOneAndOnly(isActive), booleanOneAndOnly(isOver18))
}

In this example, the condition will be true if (a) isActive contains a single value and (b) isOver18 is single-valued and both values are true. Note that the notation andFunction is rarely used. The && symbol may be used instead inside conditions. The and keyword should be used inside targets.

See Also

Related Functions

Other functions in the logical functions category:

Browse the full ALFA function reference.