Beispiel #1
0
        public static QueryRulePack GetQueryRules(Lite <RoleEntity> role, TypeEntity typeEntity)
        {
            var result = new QueryRulePack {
                Role = role, Type = typeEntity
            };

            cache.GetRules(result, QueryLogic.GetTypeQueries(typeEntity));

            var coercer = QueryCoercer.Instance.GetCoerceValue(role);

            result.Rules.ForEach(r => r.CoercedValues = EnumExtensions.GetValues <QueryAllowed>()
                                                        .Where(a => !coercer(QueryLogic.ToQueryName(r.Resource.Key), a).Equals(a))
                                                        .ToArray());

            return(result);
        }