dateSetEquals Function Description
Description
This method returns true if both sets of attribute values of type date are equal. Technically, it uses the subset function on the first and second arguments ANDed with the subset function and the second and first argument. Note that duplicate values have no impact on the comparison. For instance, the following 2 sets are equal: [a,a,c,b] and [b,c,a,c].
dateSetEquals belongs to the ALFA function reference's
Set functions category. It maps to the XACML function identifier
urn:oasis:names:tc:xacml:1.0:function:date-set-equals, takes 2 arguments and returns a value of type boolean.
| Property | Value |
|---|---|
| Category | Set functions |
| # Arguments | 2 |
| Arguments |
|
| Return Value | boolean |
| Expressed As | pre-fix |
| Representation | ALFA short name |
| Allowed In Target | false |
| ALFA Shorthand | None |
| Commutative | true |
Example
/**
* Permit a user to book one or more dates if they're the only ones available.
*/
rule dateSetEqualsExample{
permit
condition dateSetEquals(requestedDate,availableDates)
}
In this example, a user is requesting multiple dates in a single request and access will be permitted if all of the dates are available. Note, though, that access will be denied if there are more available dates than requested dates.
Related Functions
Other functions in the Set functions category: