System.Security.PermissionSetTriple.CheckAssert C# (CSharp) Method

CheckAssert() static private method

static private CheckAssert ( PermissionSet pSet, CodeAccessPermission demand, PermissionToken permToken ) : bool
pSet PermissionSet
demand CodeAccessPermission
permToken PermissionToken
return bool
        static bool CheckAssert(PermissionSet pSet, CodeAccessPermission demand, PermissionToken permToken)
        {
            if (pSet != null)
            {
                pSet.CheckDecoded(demand, permToken);

                CodeAccessPermission perm = (CodeAccessPermission)pSet.GetPermission(demand);
            
                // If the assert set does contain the demanded permission, halt the stackwalk

                try
                {
                    if ((pSet.IsUnrestricted() && demand.CanUnrestrictedOverride()) || demand.CheckAssert(perm))
                    {
                        return SecurityRuntime.StackHalt;
                    }
                }
                catch (ArgumentException)
                {
                }
            }
            return SecurityRuntime.StackContinue;
        }

Same methods

PermissionSetTriple::CheckAssert ( PermissionSet assertPset, PermissionSet demandSet, PermissionSet &newDemandSet ) : bool

Usage Example

Beispiel #1
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);
 }
All Usage Examples Of System.Security.PermissionSetTriple::CheckAssert