protected function hasGroupForRoles(array $roleGroups, LdapObjectCollection $ldapGroups)
    {
        foreach ($roleGroups as $roleGroup) {
            if (LdapUtilities::isValidLdapObjectDn($roleGroup)) {
                $attribute = 'dn';
            } elseif (preg_match(LdapUtilities::MATCH_GUID, $roleGroup)) {
                $attribute = $this->options['role_attributes']['guid'];
            } elseif (preg_match(LdapUtilities::MATCH_SID, $roleGroup)) {
                $attribute = $this->options['role_attributes']['sid'];
            } else {
                $attribute = $this->options['role_attributes']['name'];
            }

            if ($this->hasGroupWithAttributeValue($ldapGroups, $attribute, $roleGroup)) {
                return true;
            }
        }

        return false;
    }
protected function hasGroupForRoles(array $roleGroups, LdapObjectCollection $ldapGroups)
    {
        foreach ($roleGroups as $roleGroup) {
            if (LdapUtilities::isValidLdapObjectDn($roleGroup)) {
                $attribute = 'dn';
            } elseif (preg_match(LdapUtilities::MATCH_GUID, $roleGroup)) {
                $attribute = $this->options['role_attributes']['guid'];
            } elseif (preg_match(LdapUtilities::MATCH_SID, $roleGroup)) {
                $attribute = $this->options['role_attributes']['sid'];
            } else {
                $attribute = $this->options['role_attributes']['name'];
            }

            if ($this->hasGroupWithAttributeValue($ldapGroups, $attribute, $roleGroup)) {
                return true;
            }
        }

        return false;
    }
protected function hasGroupForRoles ( array $ roleGroups , LdapObjectCollection $ ldapGroups ) { foreach ( $ roleGroups as $ roleGroup ) { if ( LdapUtilities :: isValidLdapObjectDn ( $ roleGroup ) ) { $ attribute = 'dn' ; } elseif ( preg_match ( LdapUtilities :: MATCH_GUID , $ roleGroup ) ) { $ attribute = $ this -> options [ 'role_attributes' ] [ 'guid' ] ; } elseif ( preg_match ( LdapUtilities :: MATCH_SID , $ roleGroup ) ) { $ attribute = $ this -> options [ 'role_attributes' ] [ 'sid' ] ; } else { $ attribute = $ this -> options [ 'role_attributes' ] [ 'name' ] ; } if ( $ this -> hasGroupWithAttributeValue ( $ ldapGroups , $ attribute , $ roleGroup ) ) { return true ; } } return false ; }
Check all of the groups that are valid for a specific role against all of the LDAP groups that the user belongs
to.

@param array $roleGroups
@param LdapObjectCollection $ldapGroups
@return bool
Check all of the groups that are valid for a specific role against all of the LDAP groups that the user belongs to .