You work as the application developer at Domain.com.
You have to create a new security policy for an application domain which must enforce the new Domain.com security policy.
You write the code segment to do this:
PolicyLevel policy = PolicyLevel.CreateAppDomainLevel();
PolicyStatement noTrustStatement =new PolicyStatement(policy.GetNamedPermissionSet(“Nothing”));
PolicyStatement fullTrustStatement =
new PolicyStatement(
policy.GetNamedPermissionSet(“FullTrust”));
You must now ensure that all loaded assemblies default to the Nothing permission set.
In addition to this, when an assembly comes from a trusted zone, your security policy must grant the assembly the FullTrust permission set. You must create the code groups to do this.
Choose the code segment which will achieve this objective.
A.
CodeGroup group1 = new FirstMatchCodeGroup(new ZoneMembershipCondition(SecurityZone.Trusted),fullTrustStatement);
CodeGroup group2 = new UnionCoderoup(
new AllMembershipCondition(),
noTrustStatement);
group1.AddChild(group2);
B.
CodeGroup group1 = new FirstMatchCodeGroup(new AllMembershipCondition(),noTrustStatement);
CodeGroup group2 = new UnionCodeGroup(
new ZoneMembershipCondition(SecurityZone.Trusted),
fullTrustStatement);
group1.AddChild(group2);
C.
CodeGroup group = new UnionCodeGroup(new ZoneMembershipCondition(SecurityZone.Trusted),fullTrustStatement);
D.
CodeGroup group = new FirstMatchCodeGroup(new AllMembershipCondition(),noTrustStatement);
I agree with the answer. B