UrlIdentityPermission Constructor (PermissionState)
Collapse the table of content
Expand the table of content

UrlIdentityPermission Constructor (PermissionState)

Initializes a new instance of the UrlIdentityPermission class with the specified PermissionState.

Namespace:  System.Security.Permissions
Assembly:  mscorlib (in mscorlib.dll)

public UrlIdentityPermission(
	PermissionState state
)

Parameters

state
Type: System.Security.Permissions.PermissionState
One of the PermissionState values.

ExceptionCondition
ArgumentException

The state parameter is not a valid value of PermissionState.

Creates either a fully restricted (None) or Unrestricted permission.

NoteNote

In the .NET Framework versions 1.0 and 1.1, identity permissions cannot have an Unrestricted permission state value. Starting with the .NET Framework version 2.0, identity permissions can have any permission state value. This means that in 2.0 and later versions, identity permissions have the same behavior as permissions that implement the IUnrestrictedPermission interface. That is, a demand for an identity always succeeds, regardless of the identity of the assembly, if the assembly has been granted full trust.

In the .NET Framework versions 1.0 and 1.1, demands on the identity permissions are effective, even when the calling assembly is fully trusted. That is, although the calling assembly has full trust, a demand for an identity permission fails if the assembly does not meet the demanded criteria. Starting with the .NET Framework version 2.0, demands for identity permissions are ineffective if the calling assembly has full trust. This assures consistency for all permissions, eliminating the treatment of identity permissions as a special case.

The following example shows the use of the UrlIdentityPermission.UrlIdentityPermission(PermissionState) constructor.


UrlIdentityPermission permIdPerm2 = new UrlIdentityPermission(PermissionState.None);


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2016 Microsoft