Check whether any of the subject alternative names match entityName.

@param GeneralNames $san
@return boolean
551783
private function _checkEntityAlternativeNames(GeneralNames $san): bool
    {
        // only directory names supported for now
        $name = $this->_entityName->firstDN();
        foreach ($san->allOf(GeneralName::TAG_DIRECTORY_NAME) as $dn) {
            if ($dn instanceof DirectoryName && $dn->dn()->equals($name)) {
                return true;
            }
        }
        return false;
    }
775185
public function validate($subject): bool
    {
        // Validation with "additionalProperties" applies only to the child values of instance names that do
        // not match any names in "properties", and do not match any regular expression in "patternProperties".
        $subject = $this->removePropertiesFromSubject($subject, $this->schema);
        $subject = $this->removePatternPropertiesFromSubject($subject, $this->schema);
        // The value of "additionalProperties" MUST be a valid JSON Schema (including boolean false)
        if (\is_bool($this->schema['additionalProperties']) && $this->schema['additionalProperties'] === false) {
            if (count($subject) > 0) {
                return false;
            }
        } elseif (\is_array($this->schema['additionalProperties'])) {
            foreach ($subject as $propertyValue) {
                $nodeValidator = new NodeValidator($this->schema['additionalProperties'], $this->rootSchema);
                if (!$nodeValidator->validate($propertyValue)) {
                    return false;
                }
            }
        }
        return true;
    }
1087027
public static function valid_alternative_database_name($name)
    {
        if (Director::isLive() || empty($name)) {
            return false;
        }

        $prefix = Environment::getEnv('SS_DATABASE_PREFIX') ?: 'ss_';
        $pattern = strtolower(sprintf('/^%stmpdb\d{7}$/', $prefix));
        return (bool)preg_match($pattern, $name);
    }
1112566
private function namespaceMatches() : bool
    {
        $currentNamespace = ($this->currentNamespace && is_array($this->currentNamespace->name->parts))
            ? $this->currentNamespace->name->toString()
            : '';

        return $currentNamespace === $this->reflectedClass->getNamespaceName();
    }
882312
public function getNodeByEntityName($entityName)
    {
        if (false !== ($index = array_search($entityName, $this->nodesEntities))) {
            if ($this->offsetExists($index)) {
                return $this->offsetGet($index);
            }
        }

        return false;
    }
1342558
final boolean match(final Subject subject,
                        final SICoreConnection coreConnection) {

        boolean subjectsMatch = (_subject == null) ? (subject == null)
                        : (_subject.equals(subject));
        boolean coreConnectionsMatch = (coreConnection == null)
                                       || coreConnection.isEquivalentTo(_coreConnection);

        return subjectsMatch && coreConnectionsMatch && isValid();

    }
715016
public function hasGroupForName($name)
    {
        if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $name)) {
            return true;
        }
        
        return false;
    }
423815
public function validate($subject): bool
    {
        if (\is_array($this->schema['required'])) {
            foreach ($this->schema['required'] as $propertyName) {
                if (!\array_key_exists($propertyName, $subject)) {
                    return false;
                }
            }
        }
        return true;
    }
505634
protected function validateName($name)
    {
        if (!ApiKey::isValidName($name)) {
            return self::MESSAGE_ERROR_INVALID_NAME;
        }
        if (!ApiKey::nameExists($name)) {
            return self::MESSAGE_ERROR_NAME_DOES_NOT_EXIST;
        }
        return null;
    }
1318280
public function matchIdentityRoles(array $roles): bool
    {
        $identityRoles = $this->getIdentityRoles();
        // Too easy...
        if (empty($identityRoles)) {
            return false;
        }
        $roleNames = [];
        foreach ($roles as $role) {
            $roleNames[] = $role instanceof RoleInterface ? $role->getName() : (string)$role;
        }

        $identityRoleNames = [];
        foreach ($this->flattenRoles($identityRoles) as $role) {
            $identityRoleNames[] = $role->getName();
        }

        return count(array_intersect($roleNames, $identityRoleNames)) > 0;
    }
1014925
public function hasEntityPostfixByInterfaceName($entityInterfaceName)
    {
        if (!array_key_exists($entityInterfaceName, $this->interfaceNameToEntityPostfix)) {
            $has = false !== $this->buildEntityPostfixByInterfaceName($entityInterfaceName);
        } else {
            $has = false !== $this->interfaceNameToEntityPostfix[$entityInterfaceName];
        }

        return $has;
    }
1309230
private function isIdentifierEquals($entity1, $entity2)
    {
        if ($entity1 === $entity2) {
            return true;
        }

        $class = $this->em->getClassMetadata(get_class($entity1));

        if ($class !== $this->em->getClassMetadata(get_class($entity2))) {
            return false;
        }

        $oid1 = spl_object_hash($entity1);
        $oid2 = spl_object_hash($entity2);

        $id1 = isset($this->entityIdentifiers[$oid1])
            ? $this->entityIdentifiers[$oid1]
            : $this->identifierFlattener->flattenIdentifier($class, $class->getIdentifierValues($entity1));
        $id2 = isset($this->entityIdentifiers[$oid2])
            ? $this->entityIdentifiers[$oid2]
            : $this->identifierFlattener->flattenIdentifier($class, $class->getIdentifierValues($entity2));

        return $id1 === $id2 || implode(' ', $id1) === implode(' ', $id2);
    }
179954
public function equals( $other )
	{
		try
		{
			return $this->qnameValueHash == $other->qnameValueHash ||
				( $this->localName == $other->localName && $this->namespaceURI == $other->namespaceURI );
		}
		catch( \Exception $ex )
		{
			return false;
		}
	}
966397
public function isUsernameUnique($username)
    {
        if ($username) {
            try {
                $this->userRepository->findUserByUsername($username);
            } catch (NoResultException $exc) {
                return true;
            }
        }

        return false;
    }
529710
public function matchesSubject(PrivilegeSubjectInterface $subject): bool
    {
        if ($subject instanceof MethodPrivilegeSubject === false) {
            throw new InvalidPrivilegeTypeException(sprintf('Privileges of type "%s" only support subjects of type "%s", but we got a subject of type: "%s".', MethodPrivilegeInterface::class, MethodPrivilegeSubject::class, get_class($subject)), 1416241148);
        }

        $this->initialize();
        $joinPoint = $subject->getJoinPoint();

        $methodIdentifier = strtolower($joinPoint->getClassName() . '->' . $joinPoint->getMethodName());

        if (!isset(static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()])) {
            return false;
        }

        if (
            static::$methodPermissions[$methodIdentifier][$this->getCacheEntryIdentifier()]['hasRuntimeEvaluations']
            && $this->runtimeExpressionEvaluator->evaluate($this->getCacheEntryIdentifier(), $joinPoint) === false
        ) {
            return false;
        }

        return true;
    }
439493
public function ascii($subject) : bool
    {
        if ($subject === null) {
            return false;
        }
        $v = '' . $subject;
        return $v === '' ? true : !!preg_match('/^[[:ascii:]]+$/', $v);
    }
63087
public function actionNameEquals($name) {
        $actionName = strtolower($this->actionName);

        if (is_array($name)) {
            foreach ($name as $n) {
                if ($actionName == strtolower($n)) {
                    return true;
                }
            }

            return false;
        }
        else {
            return $actionName == strtolower($name);
        }
    }