System.Web 2.0.0.0 System.Object System.Security.Principal.IPrincipal

The object implements the interface and represents the current security context for the HTTP request.

When role management is enabled (see ), the assigns a object to the property of the .

The class exposes the security identity for the current HTTP request and additionally performs checks for role membership. If is true, then the object manages the cached list of roles and looks up role membership for the current user in the cached list first, then the role . If is false, the object always looks up role membership using the role provider.

The object encrypts and decrypts role information cached in the cookie identified by the based on the .

Represents security information for the current HTTP request, including role membership. This class cannot be inherited.

- Constructor

  This overload of the constructor creates a new object and initializes its property values. Cached role information is not read from the cookie identified by the property. The property is set to the of the default role provider.

  For information on enabling role management, see the class.

  Instantiates a object for the specified .

  The user identity to create the for.
  2.0.0.0
- Constructor

  This overload of the constructor creates a new object and initializes its property values. Role information for the current user is read from the supplied and cached with the object. The property is set to the of the default role provider.

  For information on enabling role management, see the class.

  Instantiates a object for the specified with role information from the specified .

  The user identity to create the for.
  A string that contains encrypted role information.
  2.0.0.0
- Constructor

  This overload of the constructor creates a new object and initializes its property values. The property is set to the value specified in the parameter.

  For information on enabling role management, see the class.

  Instantiates a object for the specified using the specified .

  The name of the role provider for the user.
  The user identity to create the for.
  2.0.0.0
- Constructor

  This overload of the constructor creates a new object and initializes its property values. Role information for the current user is read from the supplied and cached with the object. The property is set to the value specified in the parameter.

  For information on enabling role management, see the class.

  Instantiates a object for the specified using the specified and role information from the specified .

  The name of the role provider for the user.
  The user identity to create the for.
  A string that contains encrypted role information.
  2.0.0.0
- Property
  System.Boolean To be added.

  The property will return true after role names have been retrieved from the default role and added to the cache by the method, or when the method calls the method of the default role provider and then receives a response of true, resulting in the role name passed to the method being added to the cache.

  The property will also return true if is set to true and the has passed, resulting in a new being set.

  Gets a value indicating whether the list of role names cached with the object has been modified.

  2.0.0.0
- Property
  System.String To be added.

  The property returns the value of the cookiePath attribute from the Web.config file for your ASP.NET application. For more information on cookie paths, see .

  Gets the path for the cached role names cookie.

  2.0.0.0
- Property
  System.Boolean To be added.

  The property returns a Boolean value indicating whether the roles cookie has expired based on the and the current date and time.

  Gets a value indicating whether the roles cookie has expired.

  2.0.0.0
- Property
  System.DateTime To be added. To be added.

  Gets the date and time when the roles cookie will expire.

  2.0.0.0
- Method
  System.String[]

  If is true and role names have been cached for the user represented by the , then the method will return the list of role names in the cache that the user is a member of. If role names have not been cached, then the method returns the list of role names that the user is a member of from the default role . Only role names for the current are returned. To determine whether role names have been cached in the object, check the property.

  Gets a list of roles that the is a member of.

  The list of roles that the is a member of.

  2.0.0.0
- Property
  System.Security.Principal.IIdentity To be added.

  The of a object is set when the constructor is called.

  Gets the security identity for the current HTTP request.

  2.0.0.0
- Method
  System.Boolean ``

  first checks the property to determine whether a cached list of role names for the current user is available. If the property is true, the cached list is checked for the specified role. If the method finds the specified role in the cached list, it returns true.

  If does not find the specified role, it calls the method of the default instance to determine whether the user name is associated with a role from the data source for the configured value.

  Gets a value indicating whether the user represented by the is in the specified role.

  true if user represented by the is in the specified role; otherwise, false.

  The role to search for. 2.0.0.0
- Property
  System.Boolean To be added.

  If the cacheRolesInCookie attribute in the Web.config file for the application is set to true, then a list of role names for the current user is written to a cookie when user membership in a particular role is checked. The property indicates whether role names have been written to the cookie. Note that, even though the cacheRolesInCookie configuration attribute may be true, the property does not return true until after role information has been written to the cookie. If no role checks are performed for a user, will return false.

  Gets a value indicating whether the list of roles for the user has been cached in a cookie.

  2.0.0.0
- Property
  System.DateTime To be added. To be added.

  Gets the date and time that the roles cookie was issued.

  2.0.0.0
- Property
  System.String To be added.

  The property exposes the name of the role provider that manages the role information for the user represented by the object. This enables you to access the specific role-provider instance for a user by using the property of the class regardless of whether the provider is the default provider for the application. For example, you may create a method that takes a as input and returns the list of roles for the represented user. You can ensure that the appropriate role provider is used to return the list of roles for the by calling the method of the role provider from the collection that is indexed by the property value.

  To populate the object for each request, you must use a event handler defined in the Global.asax file for the application.

  Gets the name of the role provider that stores and retrieves role information for the user.

  2.0.0.0
- Method
  System.Void

  The method marks the cached role list as having been changed by setting to true and to false.

  Marks the cached role list as having been changed.

  2.0.0.0
- Method
  System.String

  The value returned by the method is stored in the roles cookie when is true.

  Returns the role information cached with the object encrypted based on the .

  The role information cached with the object encrypted based on the .

  2.0.0.0
- Property
  System.Int32 To be added.

  By including a version number in the roles cookie, future releases of ASP.NET can modify the format of the roles cookie and use the property to distinguish between different formats.

  Gets the version number of the roles cookie.

  2.0.0.0