CheckHelper() static private method

static private CheckHelper ( PermissionSet grantedSet, PermissionSet refusedSet, CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandle rmh, Object assemblyOrString, SecurityAction action, bool throwException ) : bool
grantedSet PermissionSet
refusedSet PermissionSet
demand CodeAccessPermission
permToken PermissionToken
rmh System.RuntimeMethodHandle
assemblyOrString Object
action SecurityAction
throwException bool
return bool
Beispiel #1
0
        internal static void CheckAssembly(RuntimeAssembly asm, CodeAccessPermission demand)
        {
            PermissionSet grantedSet;
            PermissionSet refusedSet;

            asm.GetGrantSet(out grantedSet, out refusedSet);
            CodeAccessSecurityEngine.CheckHelper(grantedSet, refusedSet, demand, PermissionToken.GetToken(demand), RuntimeMethodHandleInternal.EmptyHandle, asm, SecurityAction.Demand, true);
        }
Beispiel #2
0
        internal bool CheckDemandNoThrow(CodeAccessPermission demand, PermissionToken permToken)
        {
            Debug.Assert(AssertSet == null, "AssertSet not null");
#pragma warning disable 618
            return(CodeAccessSecurityEngine.CheckHelper(GrantSet, RefusedSet, demand, permToken, RuntimeMethodHandleInternal.EmptyHandle, null, SecurityAction.Demand, false));

#pragma warning restore 618
        }
        internal static void CheckAssembly(RuntimeAssembly asm, CodeAccessPermission demand)
        {
            PermissionSet newGrant;
            PermissionSet newDenied;

            asm.GetGrantSet(out newGrant, out newDenied);
            CodeAccessSecurityEngine.CheckHelper(newGrant, newDenied, demand, PermissionToken.GetToken((IPermission)demand), RuntimeMethodHandleInternal.EmptyHandle, (object)asm, SecurityAction.Demand, true);
        }
Beispiel #4
0
 internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh)
 {
     if (!PermissionSetTriple.CheckAssert(this.AssertSet, demand, permToken))
     {
         return(false);
     }
     CodeAccessSecurityEngine.CheckHelper(this.GrantSet, this.RefusedSet, demand, permToken, rmh, (object)null, SecurityAction.Demand, true);
     return(true);
 }
Beispiel #5
0
 internal static void CheckHelper(CompressedStack cs, PermissionSet grantedSet, PermissionSet refusedSet, CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandleInternal rmh, RuntimeAssembly asm, SecurityAction action)
 {
     if (cs != null)
     {
         cs.CheckDemand(demand, permToken, rmh);
         return;
     }
     CodeAccessSecurityEngine.CheckHelper(grantedSet, refusedSet, demand, permToken, rmh, asm, action, true);
 }
Beispiel #6
0
        internal bool CheckDemand(CodeAccessPermission demand, PermissionToken permToken, RuntimeMethodHandle rmh)
        {
            if (CheckAssert(AssertSet, demand, permToken) == SecurityRuntime.StackHalt)
            {
                return(SecurityRuntime.StackHalt);
            }

            CodeAccessSecurityEngine.CheckHelper(GrantSet, RefusedSet, demand, permToken, rmh, null, SecurityAction.Demand, true);

            return(SecurityRuntime.StackContinue);
        }
Beispiel #7
0
 internal bool CheckDemandNoThrow(CodeAccessPermission demand, PermissionToken permToken)
 {
     return(CodeAccessSecurityEngine.CheckHelper(this.GrantSet, this.RefusedSet, demand, permToken, RuntimeMethodHandleInternal.EmptyHandle, (object)null, SecurityAction.Demand, false));
 }
Beispiel #8
0
        internal bool CheckDemandNoThrow(CodeAccessPermission demand, PermissionToken permToken)
        {
            BCLDebug.Assert(AssertSet == null, "AssertSet not null");

            return(CodeAccessSecurityEngine.CheckHelper(GrantSet, RefusedSet, demand, permToken, s_emptyRMH, null, SecurityAction.Demand, false));
        }