ImpersonationLevelOption 枚举


指定调用服务器应用程序的目标时允许的模拟级别。Specifies the level of impersonation allowed when calling targets of a server application.

public enum class ImpersonationLevelOption
public enum ImpersonationLevelOption
type ImpersonationLevelOption = 
Public Enum ImpersonationLevelOption


Anonymous 1

客户端对于服务器而言是匿名的。The client is anonymous to the server. 服务器进程可以模拟客户端,但模拟标记不包含与客户端有关的任何信息。The server process can impersonate the client, but the impersonation token does not contain any information about the client.

Default 0

将默认的模拟级别用于指定的身份验证服务。Uses the default impersonation level for the specified authentication service. 在 COM+ 中,此设置由 DefaultImpersonationLevel 集合中的 LocalComputer 属性提供。In COM+, this setting is provided by the DefaultImpersonationLevel property in the LocalComputer collection.

Delegate 4

功能最强大的模拟级别。The most powerful impersonation level. 如果选择了该级别,则服务器(无论是本地的还是远程的)可以在代表客户端的同时模拟客户端的安全上下文。When this level is selected, the server (whether local or remote) can impersonate the client's security context while acting on behalf of the client.

Identify 2

系统默认级别。The system default level. 服务器可以获取客户端的标识,并且服务器可以模拟客户端以进行 ACL 检查。The server can obtain the client's identity, and the server can impersonate the client to do ACL checks.

Impersonate 3

服务器可以在代表客户端的同时模拟客户端的安全上下文。The server can impersonate the client's security context while acting on behalf of the client. 服务器可以访问作为客户端的本地资源。The server can access local resources as the client.


下面的代码示例演示如何将此枚举与 ApplicationAccessControlAttribute 特性结合使用。The following code example demonstrates the use of this enumeration in conjunction with the ApplicationAccessControlAttribute attribute.

// Set component access controls.
// Set component access controls.
[assembly: ApplicationAccessControl(Authentication=AuthenticationOption.Privacy,
' Set component access controls.
<Assembly: ApplicationAccessControl(Authentication:=AuthenticationOption.Privacy, ImpersonationLevel:=ImpersonationLevelOption.Identify, AccessChecksLevel:=AccessChecksLevelOption.ApplicationComponent)> 


如果模拟成功,则客户端允许服务器将客户端模拟一定程度。If impersonation succeeds, the client lets the server impersonate the client to some degree. 不同程度的模拟称为模拟级别,它们表示在模拟客户端时向服务器提供的权限量。The varying degrees of impersonation are called impersonation levels, and they indicate how much authority is given to the server when it is impersonating the client.

对于库(inproc)应用程序,唯一有效的设置 Default 或未指定。For library (inproc) applications, the only valid settings are Default or none specified.