public bool IsAccessible(string value, string dataSourceName, long userId, out DataSourceFieldInfo fieldInfo)
        {
            fieldInfo = null;

            var exprValues = GetSeparatedValues(value);

            var currentDataSourceName = dataSourceName;

            var lastSimpleValue = exprValues.LastOrDefault(_ => _queryVariableNameBuilder.IsSimpleValue(_));

            if (string.IsNullOrEmpty(lastSimpleValue))
            {
                return(true);
            }

            foreach (var exprValue in exprValues)
            {
                var isSipleValue = _queryVariableNameBuilder.IsSimpleValue(exprValue);

                if (!isSipleValue)
                {
                    continue;
                }

                if (exprValue == lastSimpleValue)
                {
                    break;
                }

                var entityName = _queryEntityNamePropertyTypeNameResolver.ResolvePropertyTypeName(
                    currentDataSourceName,
                    exprValue);

                var isCanReadCurrentDataSource = _dataSourceAccessValidator.CanReadSource(entityName, userId);

                if (!isCanReadCurrentDataSource)
                {
                    return(false);
                }

                currentDataSourceName = exprValue;
            }

            if (!string.IsNullOrEmpty(lastSimpleValue))
            {
                fieldInfo = _dataSourceFieldInfoProvider.TryGet(currentDataSourceName, lastSimpleValue, userId);
            }

            return(true);
        }
        private void ProcessSelectItem(DataSourceInfo dataSource,
                                       long userId,
                                       DslFormatItem selectItem,
                                       string selectItemProperty)
        {
            if (string.IsNullOrEmpty(selectItem.Name))
            {
                selectItem.Name = selectItemProperty;
            }

            var isValueField = _queryVariableNameBuilder.IsSimpleValue(selectItemProperty);

            if (!isValueField)
            {
                if (string.IsNullOrEmpty(selectItem.Name))
                {
                    throw new SelectFieldNameEmptyException(selectItem.Value);
                }
            }

            DataSourceFieldInfo inheritedField;

            var isCanRequestColumn = _formatBlockValueAccessEvaluator.IsAccessible(
                selectItemProperty,
                dataSource.Key,
                userId,
                out inheritedField);

            if (!isCanRequestColumn)
            {
                selectItem.Value = QueryKey.QueryEmptyString;

                return;
            }

            if (inheritedField == null)
            {
                return;
            }

            SetSelectItemInfoFromField(selectItem, inheritedField);
        }