SecurityManager.IsGranted(IPermission) 方法

定义

注意

现已弃用此 API。

注意

IsGranted is obsolete and will be removed in a future release of the .NET Framework. Please use the PermissionSet property of either AppDomain or Assembly instead.

确定是否将权限授予调用方。

public:
 static bool IsGranted(System::Security::IPermission ^ perm);
[System.Obsolete]
public static bool IsGranted (System.Security.IPermission perm);
public static bool IsGranted (System.Security.IPermission perm);
[System.Obsolete("IsGranted is obsolete and will be removed in a future release of the .NET Framework.  Please use the PermissionSet property of either AppDomain or Assembly instead.")]
public static bool IsGranted (System.Security.IPermission perm);
[<System.Obsolete>]
static member IsGranted : System.Security.IPermission -> bool
static member IsGranted : System.Security.IPermission -> bool
[<System.Obsolete("IsGranted is obsolete and will be removed in a future release of the .NET Framework.  Please use the PermissionSet property of either AppDomain or Assembly instead.")>]
static member IsGranted : System.Security.IPermission -> bool
Public Shared Function IsGranted (perm As IPermission) As Boolean

参数

perm
IPermission

针对调用方的权限授予测试的权限。

返回

Boolean

如果授予调用方的权限包括权限 perm,则为 true;否则为 false

属性

注解

授予权限由策略决定,不同于要求主体的替代,例如断言。 此外, IsGranted 仅测试调用代码程序集的授予,独立于堆栈上的其他调用方。

适用于