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

IsGranted() static private method

static private IsGranted ( Assembly a, IPermission perm ) : bool
a System.Reflection.Assembly
perm IPermission
return bool
		internal static bool IsGranted (Assembly a, IPermission perm)
		{
			PermissionSet granted = a.GrantedPermissionSet;
			if ((granted != null) && !granted.IsUnrestricted ()) {
				CodeAccessPermission grant = (CodeAccessPermission) granted.GetPermission (perm.GetType ());
				if (!perm.IsSubsetOf (grant)) {
					return false;
				}
			}

			PermissionSet denied = a.DeniedPermissionSet;
			if ((denied != null) && !denied.IsEmpty ()) {
				if (denied.IsUnrestricted ())
					return false;
				CodeAccessPermission refuse = (CodeAccessPermission) a.DeniedPermissionSet.GetPermission (perm.GetType ());
				if ((refuse != null) && perm.IsSubsetOf (refuse))
					return false;
			}
			return true;
		}

Same methods

SecurityManager.SecurityManager::IsGranted ( IPermission perm ) : bool