System.Security.SecurityManager.SecurityManager.InheritanceDemand C# (CSharp) Method

InheritanceDemand() private static method

private static InheritanceDemand ( AppDomain ad, Assembly a, RuntimeDeclSecurityActions actions ) : bool
ad AppDomain
a System.Reflection.Assembly
actions RuntimeDeclSecurityActions
return bool
		private unsafe static bool InheritanceDemand (AppDomain ad, Assembly a, RuntimeDeclSecurityActions *actions)
		{
			try {
				PermissionSet ps = null;
				bool result = true;
				if (actions->cas.size > 0) {
					ps = Decode (actions->cas.blob, actions->cas.size);
					result = (SecurityManager.CheckPermissionSet (a, ps, false) == null);
					if (result) {
						// also check appdomain
						result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
					}
				}
				if (actions->noncas.size > 0) {
					ps = Decode (actions->noncas.blob, actions->noncas.size);
					result = (SecurityManager.CheckPermissionSet (a, ps, true) == null);
					if (result) {
						// also check appdomain
						result = (SecurityManager.CheckPermissionSet (ad, ps) == null);
					}
				}
				return result;
			}
			catch (SecurityException) {
				return false;
			}
		}