You are here

protected function CasAttributesSubscriber::checkRoleMatchExactAny in CAS Attributes 8

Same name and namespace in other branches
  1. 2.x src/Subscriber/CasAttributesSubscriber.php \Drupal\cas_attributes\Subscriber\CasAttributesSubscriber::checkRoleMatchExactAny()

Check if attributes match using the 'exact_any' method.

This is the same as the 'exact_single' method, except it will check if any of the elements in a multi-value attribute match the expected value exactly.

Parameters

array $attributeValue: The actual attribute value.

string $valueToMatch: The attribute value to compare against.

Return value

bool TRUE if there's a match, FALSE otherwise.

1 call to CasAttributesSubscriber::checkRoleMatchExactAny()
CasAttributesSubscriber::doRoleMapCheck in src/Subscriber/CasAttributesSubscriber.php
Determine which roles should be added/removed based on attributes.

File

src/Subscriber/CasAttributesSubscriber.php, line 291

Class

CasAttributesSubscriber
Provides a CasAttributesSubscriber.

Namespace

Drupal\cas_attributes\Subscriber

Code

protected function checkRoleMatchExactAny(array $attributeValue, $valueToMatch) {
  foreach ($attributeValue as $value) {
    if ($value === $valueToMatch) {
      return TRUE;
    }
  }
  return FALSE;
}