public static PermissionSet ResolvePolicy(Evidence[] evidences)
{
if (!AppDomain.CurrentDomain.IsLegacyCasPolicyEnabled)
{
throw new NotSupportedException(Environment.GetResourceString("NotSupported_RequiresCasPolicyExplicit"));
}
if ((evidences == null) || (evidences.Length == 0))
{
evidences = new Evidence[1];
}
PermissionSet set = ResolvePolicy(evidences[0]);
if (set == null)
{
return(null);
}
for (int i = 1; i < evidences.Length; i++)
{
set = set.Intersect(ResolvePolicy(evidences[i]));
if ((set == null) || set.IsEmpty())
{
return(set);
}
}
return(set);
}