System.Security.Principal.GenericPrincipal Class

Assembly: Mscorlib.dll
Namespace: System.Security.Principal
Summary
Represents a generic principal.
C# Syntax:
[Serializable]
public class GenericPrincipal : IPrincipal
Remarks
This class represents the roles of the current user.
See also:
System.Security.Principal Namespace

System.Security.Principal.GenericPrincipal Member List:

Public Constructors
ctor #1 Initializes a new instance of the GenericPrincipal class from a GenericIdentity and an array of role names to which the user represented by that GenericIdentity belongs.
Public Properties
Identity Read-only

Gets the GenericIdentity of the user represented by the current GenericPrincipal.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
IsInRole Determines whether the current GenericPrincipal belongs to the specified role.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Security.Principal.GenericPrincipal Member Details

ctor #1
Summary
Initializes a new instance of the GenericPrincipal class from a GenericIdentity and an array of role names to which the user represented by that GenericIdentity belongs.
C# Syntax:
public GenericPrincipal(
   IIdentity identity,
   string[] roles
);
Parameters:

identity

A basic implementation of IIdentity that represents any user.

roles

An array of role names to which the user represented by the identity parameter belongs.

Exceptions
Exception Type Condition
ArgumentNullException The identity parameter is null.

Return to top


Property: Identity (read-only)
Summary
Gets the GenericIdentity of the user represented by the current GenericPrincipal.
C# Syntax:
public virtual IIdentity Identity {get;}
Implements:
IPrincipal.Identity

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~GenericPrincipal();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: IsInRole(
   string role
)
Summary
Determines whether the current GenericPrincipal belongs to the specified role.
C# Syntax:
public virtual bool IsInRole(
   string role
);
Parameters:

role

The name of the role for which to check membership.

Return Value:
true if the current GenericPrincipal is a member of the specified role; otherwise, false.
Implements:
IPrincipal.IsInRole

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.