Game Development Reference
In-Depth Information
The root code group combines all permissions of its children.
policyLevel.RootCodeGroup = codeGroup;
Set the new policy level of the temporary AppDomain .
appDomain.SetAppDomainPolicy(policyLevel);
}
The following method is used to locate a named permission set within Windows.
In this example, we use it to locate the Local Intranet permission set.
private NamedPermissionSet FindNamedPermissionSet(string name)
{
IEnumerator policyEnumerator = SecurityManager.PolicyHierarchy();
while (policyEnumerator.MoveNext())
{
PolicyLevel currentLevel = (PolicyLevel)policyEnumerator.Current;
if (currentLevel.Label == “Machine”)
{
IList namedPermissions = currentLevel.NamedPermissionSets;
IEnumerator namedPermission = namedPermissions.GetEnumerator();
while (namedPermission.MoveNext())
{
if (((NamedPermissionSet)namedPermission.Current).Name == name)
{
return ((NamedPermissionSet)namedPermission.Current);
}
}
}
}
return null;
}
Note
The default settings for Local Intranet disable runtime compilation of source code within the tem-
porary AppDomain enforcing it. Runtime code compilation can open the door to malicious scripts,
so it is recommended that you only support this feature in a trusted environment.
 
Search Nedrilad ::




Custom Search