Example #1
0
 public Permission?ResolveMethodPermission(MethodInfo methodInfo, object context, params Type[] genericArguments)
 {
     return(RuleMaps.Aggregate((Permission?)null, (result, ruleMap) => {
         if (result == null && ruleMap == null)
         {
             return null;
         }
         return result ?? Permission.None | (ruleMap.ResolveMethodPermission(methodInfo, context, genericArguments) ?? Permission.None);
     }));
 }
Example #2
0
 public Permission?ResolveTypePermission(object context)
 {
     return(RuleMaps.Aggregate((Permission?)null, (result, ruleMap) => {
         if (result == null && ruleMap == null)
         {
             return null;
         }
         return result ?? Permission.None | (ruleMap.ResolveTypePermission(context) ?? Permission.None);
     }));
 }
Example #3
0
 public bool ShouldFilterForProperty(PropertyInfo propertyInfo, object context)
 {
     return(RuleMaps.Aggregate(true, (result, ruleMap) => result && ruleMap.ShouldFilterForProperty(propertyInfo, context)));
 }
Example #4
0
 public bool ShouldFilterForMethod(MethodInfo methodInfo, object context, Type[] genericArguments)
 {
     return(RuleMaps.Aggregate(true, (result, ruleMap) => result && ruleMap.ShouldFilterForMethod(methodInfo, context, genericArguments)));
 }
Example #5
0
 public bool HasAnyInstancePropertyPermissionResolverExpression(PropertyInfo propertyInfo, object key)
 {
     return(RuleMaps.Aggregate(false, (result, ruleMap) => result || ruleMap.HasAnyInstancePropertyPermissionResolverExpression(propertyInfo, key)));
 }