private function getBooleanOperationAttribute(string $resourceClass, array $options, string $attributeName, bool $default): bool
    {
        $resourceMetadata = $this->resourceMetadataFactory->create($resourceClass);

        if (isset($options['collection_operation_name'])) {
            $attribute = $resourceMetadata->getCollectionOperationAttribute($options['collection_operation_name'], $attributeName, null, true);
        } elseif (isset($options['item_operation_name'])) {
            $attribute = $resourceMetadata->getItemOperationAttribute($options['item_operation_name'], $attributeName, null, true);
        } else {
            $attribute = $resourceMetadata->getAttribute($attributeName);
        }

        return \is_bool($attribute) ? $attribute : $default;
    }