NamedPermissionSet Constructors

Definition

Initializes a new instance of the NamedPermissionSet class.

Overloads

NamedPermissionSet(NamedPermissionSet)

Initializes a new instance of the NamedPermissionSet class from another named permission set.

NamedPermissionSet(String)

Initializes a new, empty instance of the NamedPermissionSet class with the specified name.

NamedPermissionSet(String, PermissionState)

Initializes a new instance of the NamedPermissionSet class with the specified name in either an unrestricted or a fully restricted state.

NamedPermissionSet(String, PermissionSet)

Initializes a new instance of the NamedPermissionSet class with the specified name from a permission set.

NamedPermissionSet(NamedPermissionSet)

Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs

Initializes a new instance of the NamedPermissionSet class from another named permission set.

public NamedPermissionSet (System.Security.NamedPermissionSet permSet);

Parameters

permSet
NamedPermissionSet

The named permission set from which to create the new instance.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

NamedPermissionSet(String)

Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs

Initializes a new, empty instance of the NamedPermissionSet class with the specified name.

public NamedPermissionSet (string name);

Parameters

name
String

The name for the new named permission set.

Exceptions

The name parameter is null or is an empty string ("").

Remarks

Using this constructor creates a named permission set with no permissions but with an Unrestricted permission state. A named permission set in an unrestricted state effectively contains all permissions that implement the IUnrestrictedPermission interface. The named permission set will contain all built-in permissions as well as all custom user-defined permissions that implement IUnrestrictedPermission. All permissions will have the equivalent of an Unrestricted permission state. Permissions that do not implement IUnrestrictedPermission will be empty instances.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

NamedPermissionSet(String, PermissionState)

Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs

Initializes a new instance of the NamedPermissionSet class with the specified name in either an unrestricted or a fully restricted state.

public NamedPermissionSet (string name, System.Security.Permissions.PermissionState state);

Parameters

name
String

The name for the new named permission set.

state
PermissionState

One of the PermissionState values.

Exceptions

The name parameter is null or is an empty string ("").

Remarks

A named permission set in an unrestricted state effectively contains all permissions that implement the IUnrestrictedPermission interface. The named permission set will contain all built-in permissions as well as all custom permissions. All permissions will have an Unrestricted PermissionState. Permissions that do not implement IUnrestrictedPermission, such as identity permissions, will be empty instances.

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

NamedPermissionSet(String, PermissionSet)

Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs
Source:
NamedPermissionSet.cs

Initializes a new instance of the NamedPermissionSet class with the specified name from a permission set.

public NamedPermissionSet (string name, System.Security.PermissionSet permSet);

Parameters

name
String

The name for the named permission set.

permSet
PermissionSet

The permission set from which to take the value of the new named permission set.

Exceptions

The name parameter is null or is an empty string ("").

Applies to

.NET 9 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7 (package-provided), 4.7, 4.7.1 (package-provided), 4.7.1, 4.7.2 (package-provided), 4.7.2, 4.8 (package-provided), 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9