stringAtLeastOneMemberOf Function Description
Description
This function takes in two parameters of type bag of string and returns true if there is at least one value in the first bag equal to at least one value in the second bag.
stringAtLeastOneMemberOf 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:string-at-least-one-member-of, 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
/**
* Driver's test: this rule checks that a user has at least one
* qualification in order to drive a vehicle. At least one value of the
* userQualifications bag must be in the vehicleRequirements bag.
* A user can have more qualifications though and access should still
* be granted so long as the user has at least one requirement inside
* userQualifications.
*/
rule stringAtLeastOneMemberOfExample{
permit
condition stringAtLeastOneMemberOf(userQualifications, vehicleRequirements)
}
In this example, we revisit the "driver's license" check. In this case, though, it's sufficient for the user to have one requirement rather than all (as in the other driver examples). The rule will return Permit if there is at least one value in userQualifications equal to at least one value in vehicleRequirements.
See Also
- anyOfAny
- anyURIAtLeastOneMemberOf
- base64BinaryAtLeastOneMemberOf
- booleanAtLeastOneMemberOf
- dateAtLeastOneMemberOf
- dateTimeAtLeastOneMemberOf
- dayTimeDurationAtLeastOneMemberOf
- doubleAtLeastOneMemberOf
- hexBinaryAtLeastOneMemberOf
- integerAtLeastOneMemberOf
- rfc822NameAtLeastOneMemberOf
- timeAtLeastOneMemberOf
- x500NameAtLeastOneMemberOf
- yearMonthDurationAtLeastOneMemberOf
Related Functions
Other functions in the Set functions category: