PrincipalPermission Constructors

Definition

Initializes a new instance of the PrincipalPermission class.

Overloads

PrincipalPermission(PermissionState)

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

PrincipalPermission(String, String)

Initializes a new instance of the PrincipalPermission class for the specified name and role.

PrincipalPermission(String, String, Boolean)

Initializes a new instance of the PrincipalPermission class for the specified name, role, and authentication status.

PrincipalPermission(PermissionState)

Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs

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

public:
 PrincipalPermission(System::Security::Permissions::PermissionState state);
public PrincipalPermission(System.Security.Permissions.PermissionState state);
new System.Security.Permissions.PrincipalPermission : System.Security.Permissions.PermissionState -> System.Security.Permissions.PrincipalPermission
Public Sub New (state As PermissionState)

Parameters

state
PermissionState

One of the PermissionState values.

Exceptions

The state parameter is not a valid PermissionState.

Remarks

None matches only the unauthenticated principal (Name is the empty string (""), no Role, Authenticated is false). Unrestricted matches all principals (Name is null, Role is null).

Note

This constructor is included for consistency with the design of other permissions, but is not useful in practice.

Applies to

PrincipalPermission(String, String)

Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs

Initializes a new instance of the PrincipalPermission class for the specified name and role.

public:
 PrincipalPermission(System::String ^ name, System::String ^ role);
public PrincipalPermission(string name, string role);
new System.Security.Permissions.PrincipalPermission : string * string -> System.Security.Permissions.PrincipalPermission
Public Sub New (name As String, role As String)

Parameters

name
String

The name of the IPrincipal object's user.

role
String

The role of the IPrincipal object's user (for example, Administrator).

Remarks

Both the name parameter and the role parameter must match for this permission to match the active IPrincipal and associated IIdentity. Set name to null to check for any user in a role.

Applies to

PrincipalPermission(String, String, Boolean)

Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs
Source:
PrincipalPermission.cs

Initializes a new instance of the PrincipalPermission class for the specified name, role, and authentication status.

public:
 PrincipalPermission(System::String ^ name, System::String ^ role, bool isAuthenticated);
public PrincipalPermission(string name, string role, bool isAuthenticated);
new System.Security.Permissions.PrincipalPermission : string * string * bool -> System.Security.Permissions.PrincipalPermission
Public Sub New (name As String, role As String, isAuthenticated As Boolean)

Parameters

name
String

The name of the IPrincipal object's user.

role
String

The role of the IPrincipal object's user (for example, Administrator).

isAuthenticated
Boolean

true to signify that the user is authenticated; otherwise, false.

Remarks

Both the name parameter and the role parameter must match for this permission to match the active IPrincipal and associated IIdentity.

Applies to