本文整理汇总了C#中System.Security.PermissionSet.CanUnrestrictedOverride方法的典型用法代码示例。如果您正苦于以下问题:C# PermissionSet.CanUnrestrictedOverride方法的具体用法?C# PermissionSet.CanUnrestrictedOverride怎么用?C# PermissionSet.CanUnrestrictedOverride使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Security.PermissionSet
的用法示例。
在下文中一共展示了PermissionSet.CanUnrestrictedOverride方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckImmediate
internal virtual void CheckImmediate(PermissionSet permSet, ref StackCrawlMark stackMark)
{
if (PreCheck(null, permSet, CHECK_SET, ref stackMark, PermissionType.DefaultFlag) == true)
return;
CheckSet(permSet,
ref stackMark,
ImmediateCheckCount,
permSet.CanUnrestrictedOverride() );
}
示例2: LazyCheckSetHelper
private static void LazyCheckSetHelper( PermissionSet demands, IntPtr asmSecDesc )
{
if (demands.CanUnrestrictedOverride() == 1)
return;
PermissionSet grants;
PermissionSet denied;
_GetGrantedPermissionSet( asmSecDesc, out grants, out denied );
CheckSetHelper( grants, denied, demands );
}
示例3: PreCheck
// true - Check passes
// false - Check may fail, do a stackwalk
// It may look like we dont need three arguments here, but this is being done to
// avoid "is instance of" checks and casting
private bool PreCheck( CodeAccessPermission permObj,
PermissionSet permSetObj,
int capOrSet,
ref StackCrawlMark stackMark,
PermissionType permType)
{
//return false;
int status=0;
PermissionListSet psl;
if (capOrSet == CHECK_CAP)
psl = GetDomainPermissionListSet(out status, permObj, capOrSet, permType);
else
psl = GetDomainPermissionListSet(out status, permSetObj, capOrSet, permType);
if (status == NEED_UPDATED_PLS)
psl = UpdateDomainPermissionListSet(out status);
if (status == DEMAND_PASSES || status == SECURITY_OFF)
return true;
if (status == FULLY_TRUSTED)
{
if (capOrSet == CHECK_CAP)
{
if (permObj is IUnrestrictedPermission)
return true;
}
else
{
if (permSetObj.CanUnrestrictedOverride() == 1)
return true;
}
}
if (status == CONTINUE || status == FULLY_TRUSTED)
{
if (capOrSet == CHECK_CAP)
return psl.CheckDemandNoThrow( permObj );
else
return psl.CheckSetDemandNoThrow( permSetObj );
}
if (status == PLS_IS_BUSY)
return false;
if (status == BELOW_THRESHOLD)
return false;
if (status == MULTIPLE_DOMAINS)
return false;
if (status == OVERRIDES_FOUND)
{
UpdateOverridesCount(ref stackMark);
return false;
}
if (status == NEED_STACKWALK)
return false;
BCLDebug.Assert(false,"Unexpected status from GetDomainPermissionListSet");
return false;
}
示例4: LazyCheckSetHelper
private static void LazyCheckSetHelper(PermissionSet demands,
IntPtr asmSecDesc,
RuntimeMethodHandle rmh,
Assembly assembly,
SecurityAction action)
{
if (demands.CanUnrestrictedOverride())
return;
PermissionSet grants;
PermissionSet refused;
_GetGrantedPermissionSet( asmSecDesc, out grants, out refused );
CheckSetHelper( grants, refused, demands, rmh, (Object)assembly, action, true );
}