mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.Object System.Security.IPermission System.Security.Permissions.IBuiltInPermission System.Security.Permissions.IUnrestrictedPermission System.Runtime.InteropServices.ComVisible(true)

By passing identity information (user name and role) to the constructor, can be used to demand that the identity of the active principal matches this information.

To match the active and associated , both the specified identity and role must match. If null identity string is used, it is interpreted as a request to match any identity. Use of null role string will match any role. By implication, passing null parameter for or to will match the identity and roles in any . It is also possible to construct a that only determines whether the represents an authenticated or unauthenticated entity. In this case, and are ignored.

Unlike most other permissions, does not extend . It does, however, implement the interface. This is because is not a code access permission; that is, it is not granted based on the identity of the executing assembly. Instead, it allows code to perform actions (, , , and so on) against the current user identity in a manner consistent with the way those actions are performed for code access and code identity permissions.

Prior to a demand for principal permission it is necessary to set the current application domain's principal policy to the enumeration value . By default, the principal policy is set to . If you do not set the principal policy to , a demand for principal permission will fail. The following code should be executed before the principal permission is demanded:

AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal).

Allows checks against the active principal (see ) using the language constructs defined for both declarative and imperative security actions. This class cannot be inherited.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

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

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

  Initializes a new instance of the class with the specified .

  One of the values.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

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

  Initializes a new instance of the class for the specified and .

  The name of the object's user.
  The role of the object's user (for example, Administrator).
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  Both the parameter and the parameter must match for this permission to match the active and associated .

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

  The name of the object's user.
  The role of the object's user (for example, Administrator).
  true to signify that the user is authenticated; otherwise, false.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission

  A copy of the permission represents the same principal and identity as the original permission.

  Creates and returns an identical copy of the current permission.

  A copy of the current permission.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  If no is raised, succeeds.

  This method acts against the principal attached to the calling thread.

  Prior to calling the method, it is necessary to set the current application domain's principal policy to the enumeration value . By default the principal policy is set to . If you do not set the principal policy to , a demand for principal permission will fail. The following code should be executed before the demand for principal permission occurs:

  AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal).

  Determines at run time whether the current principal matches the principal specified by the current permission.

- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Boolean ``

  For more information, see .

  Determines whether the specified object is equal to the current .

  true if the specified is equal to the current object; otherwise, false.

  The object to compare with the current .
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` To be added

  Reconstructs a permission with a specified state from an XML encoding.

  The XML encoding to use to reconstruct the permission.
- Method
  2.0.0.0
  4.0.0.0
  System.Runtime.InteropServices.ComVisible(false)
  System.Int32

  The hash code for two instances of the same permission might be different, hence a hash code should not be used to compare two objects.

  Gets a hash code for the object that is suitable for use in hashing algorithms and data structures such as a hash table.

  A hash code for the current object.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission ``

  Because two users never intersect, this method is not useful for . For example,

  code reference: System.Security.Permissions.PrincipalPermission#1

  is equivalent to

  code reference: System.Security.Permissions.PrincipalPermission#2

  because no identity can simultaneously represent both Bob and Louise. In effect, pp1.Demand() only succeeds if an unauthenticated principal (with name equal to the empty string ("")) is allowed to act in the Administrator role.

  Creates and returns a permission that is the intersection of the current permission and the specified permission.

  A new permission that represents the intersection of the current permission and the specified permission. This new permission will be null if the intersection is empty.

  A permission to intersect with the current permission. It must be of the same type as the current permission.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean ``

  The current permission is a subset of the specified permission if all demands that succeed for the current permission also succeed for the specified permission.

  Determines whether the current permission is a subset of the specified permission.

  true if the current permission is a subset of the specified permission; otherwise, false.

  A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean

  An unrestricted matches any principal.

  Returns a value indicating whether the current permission is unrestricted.

  true if the current permission is unrestricted; otherwise, false.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.String To be added.

  Creates and returns a string representing the current permission.

  A representation of the current permission.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.SecurityElement To be added

  Creates an XML encoding of the permission and its current state.

  An XML encoding of the permission, including any state information.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Security.IPermission ``

  creates a permission representing the criteria of a given set of individual objects. It is useful for compactly representing a set of conditions to test. For example, with the declarations

  code reference: System.Security.Permissions.PrincipalPermission#3

  (ppBob.Union(ppLouise)).Demand() will succeed if the current principal represents Bob in the role of Administrator or Louise in the role of Administrator.

  Creates a permission that is the union of the current permission and the specified permission.

  A new permission that represents the union of the current permission and the specified permission.

  A permission to combine with the current permission. It must be of the same type as the current permission.