private static PropertyInfo findByName(IApplication app, bool isSet, object target, string name, string[] groups) { if (target != null && name.IsNotNullOrWhiteSpace()) { name = name.Trim(); var tp = target.GetType(); var props = suitableProperties(tp); foreach (var prop in props) { var atr = prop.GetCustomAttributes(typeof(ExternalParameterAttribute), false).FirstOrDefault() as ExternalParameterAttribute; if (atr == null) { continue; } if (groups != null && groups.Length > 0) { if (atr.Groups == null) { continue; } if (!atr.Groups.Intersect(groups).Any()) { continue; } } string pname; if (atr.Name.IsNullOrWhiteSpace()) { pname = prop.Name; } else { pname = atr.Name; } if (string.Equals(name, pname, StringComparison.InvariantCultureIgnoreCase)) //MATCH { if ( //check security (isSet && (atr.SecurityCheck & ExternalParameterSecurityCheck.OnSet) != 0) || (!isSet && (atr.SecurityCheck & ExternalParameterSecurityCheck.OnGet) != 0) ) { if (isSet) { //throws Permission.AuthorizeAndGuardAction(app, prop); } else { //filter out, do not throw if (!Permission.AuthorizeAction(app, prop)) { return(null); //not found because of lack of security } } } return(prop); } } } return(null); }