Programmatically determining the Internet trust permission set
trust permission set is on my machine.
If I understand correctly it will be the intersection of the Internet
permission sets found in the Enterprise, User and Machine security policy's.
If that is the case, then is this batch of pseudo-code is what I'm looking
for? Is there a simplier solution?
PermissionSet internetPermissionSet = new
PermissionSet(PermissionState.Unrestricted);
foreach(PolicyLevel level in SecurityManager.PolicyHierarchy())
{
Console.WriteLine("Policy Level: {0}", level.Label);
foreach(NamedPermissionSet permissionSet in level.NamedPermissionSets)
{
if (permissionSet.Name.Equals("Internet") {
internetPermissionSet =
internetPermissionSet.Intersect(permissionSet);
}
}
}
If say internetPermissionSet.PermitOnly(), am I testing in effectivly the
same security environment as an application hosted in IE and downloaded from
the internet?
My main purpose here is to make our unit tests as strong as possible, so
that they encounter few failures when we start deployment testing.
Thanks
Mark Levison

