private void SetFieldLevel(FieldInfo field) { var fieldName = field.Name; var indexingInfo = field.IndexingInfo; QueryFieldLevel level; if (fieldName == LucObject.FieldName.AllText) { level = QueryFieldLevel.BinaryOrFullText; } else if (indexingInfo == null) { level = QueryFieldLevel.BinaryOrFullText; } else if (indexingInfo.FieldDataType == typeof(SenseNet.ContentRepository.Storage.BinaryData)) { level = QueryFieldLevel.BinaryOrFullText; } else if (fieldName == LucObject.FieldName.InFolder || fieldName == LucObject.FieldName.InTree || fieldName == LucObject.FieldName.Type || fieldName == LucObject.FieldName.TypeIs || _headOnlyFields.Contains(fieldName)) { level = QueryFieldLevel.HeadOnly; } else { level = QueryFieldLevel.NoBinaryOrFullText; } FieldLevel = (QueryFieldLevel)(Math.Max((int)level, (int)FieldLevel)); }
public PermissionFilter(SnQuery query, IQueryContext context) { _userId = context.UserId; _user = Node.LoadNode(_userId) as IUser; _queryFieldLevel = GetFieldLevel(query); _allVersions = query.AllVersions; }
public PermissionFilter(IUser user, QueryFieldLevel queryFieldLevel, bool allVersions) { _userId = user.Id; _user = user; _queryFieldLevel = queryFieldLevel; _allVersions = allVersions; }
internal static LucQuery Create(Query luceneQuery, QueryFieldLevel level) { var query = new LucQuery { Query = luceneQuery }; query.TraceInfo.InputText = ""; query.FieldLevel = level; return(query); }
private Query ParseTermExp() { //TermExp ==> UnaryTermExp | BinaryTermExp | QueryExpGroup | DefaultFieldExp Query result = null; var fieldInfo = ParseFieldHead(); if (fieldInfo != null) { _currentField.Push(fieldInfo); } else if (_currentField.Count != 0) { _currentField.Push(_currentField.Peek()); } else { _currentField.Push(FieldInfo.Default); FieldLevel = QueryFieldLevel.BinaryOrFullText; } result = ParseUnaryTermExp(); if (result != null) { _currentField.Pop(); return(result); } result = ParseBinaryTermExp(); if (result != null) { _currentField.Pop(); return(result); } result = ParseQueryExpGroup(); if (result != null) { _currentField.Pop(); return(result); } result = ParseDefaultFieldExp(); if (result != null) { _currentField.Pop(); return(result); } throw ParserError("Expected field expression, expression group or simple term."); }
public PermissionChecker(IUser user, QueryFieldLevel queryFieldLevel, bool allVersions) { _user = user; _queryFieldLevel = queryFieldLevel; _allVersions = allVersions; }
public ServicePermissionFilter(SecurityHandler security, QueryFieldLevel queryFieldLevel, bool allVersions) { _security = security; _allVersions = allVersions; _queryFieldLevel = queryFieldLevel; }