当前位置: 首页>>代码示例>>C#>>正文


C# PermissionSet.CanUnrestrictedOverride方法代码示例

本文整理汇总了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() );
        }
开发者ID:ArildF,项目名称:masters,代码行数:10,代码来源:codeaccesssecurityengine.cs

示例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 );
        }
开发者ID:ArildF,项目名称:masters,代码行数:12,代码来源:codeaccesssecurityengine.cs

示例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;
        }
开发者ID:ArildF,项目名称:masters,代码行数:67,代码来源:codeaccesssecurityengine.cs

示例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 );
        }
开发者ID:gbarnett,项目名称:shared-source-cli-2.0,代码行数:16,代码来源:codeaccesssecurityengine.cs


注:本文中的System.Security.PermissionSet.CanUnrestrictedOverride方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。