private static RequestAttributes[] ToAllowedFlagsSet(RequestAttributes[] restrictToAny)
{
if (restrictToAny.Length == 0)
return new[] { RequestAttributes.Any };
var scenarios = new List<RequestAttributes>();
foreach (var restrictToScenario in restrictToAny)
{
var restrictTo = restrictToScenario.ToAllowedFlagsSet();
scenarios.Add(restrictTo);
}
return scenarios.ToArray();
}