Resolve policy for the code group and its descendants for a set of evidence. Given evidence for an assembly to be loaded, this method evalutes the code group by first checking the membership condition against the evidence and if it matches returning a policy statement for the code group, including evaluation of child code groups.
For first-match code groups, each child code groups membership condition is tested in order against the evidence, and (only) the first one to match is resolved with the evidence set. If none match, then the policy statement of the parent first-match code group applies. The matching child code group type determines how its (grand)child groups are applied, depending on how their respective Resolve() methods work.
The system uses Resolve() on the policy levels to determine what permissions to grant to loaded code from the resultant policy statements and the code request on the assembly.
[Visual Basic] Overridable Public Function Resolve( _ ByVal evidence As Evidence _ ) As PolicyStatement [C#] public virtual PolicyStatement Resolve( Evidence evidence ); [C++] public: virtual PolicyStatement* Resolve( Evidence* evidence ); [JScript] public function Resolve( evidence : Evidence ) : PolicyStatement;
Policy statement consisting of permission granted by the code group, with optional attributes. Or a NULL value if the code group does not apply (membership condition does not match evidence).
This method operates as follows:
if membership condition does not match evidence, return NULL, else set P = code group's policy statement, and continue. for each child code group: (resolve code group with the same evidence; if non-NULL result, return that policy statement.) if no child code group matched, then return P (parent's policy statement)
FirstMatchCodeGroup Class | FirstMatchCodeGroup Members | System.Security.Policy Namespace