Checks whether this ClientEntity has the given grant type.

@param string $grantType The grant type to check.

@return boolean
329449
public function hasGrantType($grantType)
    {
        $grants = explode(',', $this->Grants);

        return !empty($grants) && in_array($grantType, $grants);
    }
883649
public function isDoiAuthenticatedClients($doiValue, $client_id = null)
    {
        if ($client_id === null) {
            return false;
        }

        $client = $this->getAuthenticatedClient();

        if ($client->client_id != $client_id) {
            return false;
        }

        // everyone has access to test prefix
        if (strpos($doiValue, DOIServiceProvider::$globalTestPrefix) === 0) {
            return true;
        }

        // check if the client owns the prefix
        foreach ($client->prefixes as $clientPrefix) {
            if (strpos($doiValue, $clientPrefix->prefix->prefix_value) === 0) {
                return true;
            }
        }

        return false;
    }
524197
public function getOauth2AccessToken($code, $grantType = 'authorization_code')
    {
        $result = $this->httpGet(self::WECHAT_OAUTH2_ACCESS_TOKEN_PREFIX, [
            'appid' => $this->appId,
            'secret' => $this->appSecret,
            'code' => $code,
            'grant_type' => $grantType
        ]);
        return !array_key_exists('errcode', $result) ? $result : false;
    }
947427
protected function isFormWidget($fieldType)
    {
        if ($fieldType === null) {
            return false;
        }

        if (strpos($fieldType, '\\')) {
            return true;
        }

        $widgetClass = $this->widgetManager->resolveFormWidget($fieldType);

        if (!class_exists($widgetClass)) {
            return false;
        }

        if (is_subclass_of($widgetClass, 'Backend\Classes\FormWidgetBase')) {
            return true;
        }

        return false;
    }
387476
public function isType($type)
    {
        if ($this->has(strtolower($type))) {
            return true;
        }

        return $this->detectType() === $type;
    }
1143965
public function checkClientCredentials($clientId, $clientSecret = null)
    {
        $client = $this->getClientDataMapper()->findByUuid($clientId);

        if (! $client instanceof Entity\Client) {
            return false;
        }

        return $this->password->verify($clientSecret, $client->getSecret());
    }
548974
protected function handlesGrant($record, $grantType)
    {
        if (is_array($record->grant_types) && ! in_array($grantType, $record->grant_types)) {
            return false;
        }

        switch ($grantType) {
            case 'authorization_code':
                return ! $record->firstParty();
            case 'personal_access':
                return $record->personal_access_client;
            case 'password':
                return $record->password_client;
            case 'client_credentials':
                return ! empty($record->secret);
            default:
                return true;
        }
    }
1262234
private function hasNullOrIntegerType(?Type $staticType): bool
    {
        if ($staticType instanceof UnionType) {
            return $staticType->isSuperTypeOf(new IntegerType())->yes() && $staticType->isSuperTypeOf(
                new ConstantBooleanType(false)
            )->yes();
        }

        return false;
    }
296989
public function hasDoctrineTypeMappingFor($dbType)
    {
        if ($this->doctrineTypeMapping === null) {
            $this->initializeAllDoctrineTypeMappings();
        }

        $dbType = strtolower($dbType);

        return isset($this->doctrineTypeMapping[$dbType]);
    }
674002
public static function canOpenType($type)
    {
        self::checkRequirements();

        return (isset(self::$enabledTypes[$type]))
            ? self::$enabledTypes[$type]
            : false;
    }
706632
public function checkRestrictedGrantType($client_id, $grant_type)
	{
		// get client details
		$client = $this->getClientDetails($client_id);

		// check to make sure grant type is acceptable for client
		if (isset($client['grant_types']))
		{
			$grant_types = explode(' ', $client['grant_types']);
			return in_array($grant_type, (array) $grant_types);
		}

		return true;
	}
1157003
public function getUserEntityByUserCredentials(
        $username,
        $password,
        $grantType,
        ClientEntityInterface $clientEntity
    ) {
        $user = new \Concrete\Core\User\User($username, $password);
        if ($user && !$user->isError() && $user->isActive()) {
            return $this->getEntityManager()->getRepository(User::class)->find($user->getUserID());
        }
    }
414205
public function setPermissionType($permissionType) {
    $this->permissionType = $permissionType;
    $this->actionKeyProvider->setEntityType($this->permissionType);
  }
725778
public function check(string $type, string $context): bool
    {
        /** @var DataSource $dataSource */
        $dataSource = $this->dataSourceRepository->findOneBy(['name' => $type]);
        if (!$dataSource) {
            // unknown data source
            return false;
        }

        if (!in_array($context, $dataSource->getContext())) {
            return false;
        }

        return true;
    }
1211511
public function make(string $type)
    {
        if (isset($this->iocContainerArray[$type])) {
            $type = $this->iocContainerArray[$type];

            return $type();
        }
        throw new ClientException('No type registered with that name');
    }
1226938
public function hasFlagsOfType($type)
    {
        if ($this->flags === null) {
            return false;
        }

        foreach ($this->flags as $flag) {
            if ($flag->type == $type) {
                return true;
            }
        }

        return false;
    }
1146799
public function getUserEntityByUserCredentials(
        $username,
        $password,
        $grantType,
        ClientEntityInterface $clientEntity
    ): ?UserEntityInterface {
        $builder = $this->connection->createQueryBuilder();
        $user = $builder->select(['user.id', 'user.password'])
            ->from('user')
            ->where('username = :username')
            ->setParameter('username', $username)
            ->execute()
            ->fetch();

        if (!$user) {
            return null;
        }

        if (!password_verify($password, $user['password'])) {
            return null;
        }

        return new User(Uuid::fromBytesToHex($user['id']));
    }