Class User
Provides base user functionality. Particular security manager implementations may return users derived from this class
Inheritance
System.Object
User
Implements
System.Security.Principal.IIdentity
System.Security.Principal.IPrincipal
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.dll
Syntax
[Serializable]
public class User : IIdentityDescriptor, IIdentity, IPrincipal
Constructors
User(Credentials, AuthenticationToken, UserStatus, String, String, Rights, Nullable<DateTime>)
Declaration
public User(Credentials credentials, AuthenticationToken token, UserStatus status, string name, string descr, Rights rights, DateTime? utcNow = default(DateTime? ))
Parameters
User(Credentials, AuthenticationToken, String, Rights, Nullable<DateTime>)
Declaration
public User(Credentials credentials, AuthenticationToken token, string name, Rights rights, DateTime? utcNow = default(DateTime? ))
Parameters
Properties
AuthenticationType
Implementation of IIdentity interface
Declaration
public string AuthenticationType { get; }
Property Value
Type |
Description |
System.String |
|
AuthToken
Declaration
public AuthenticationToken AuthToken { get; }
Property Value
Credentials
Declaration
public Credentials Credentials { get; }
Property Value
Description
Declaration
public string Description { get; }
Property Value
Type |
Description |
System.String |
|
Fake
Returns default instance of the fake user that has no rights
Declaration
public static User Fake { get; }
Property Value
Identity
Implementation of IPrincipal interface
Declaration
public IIdentity Identity { get; }
Property Value
Type |
Description |
System.Security.Principal.IIdentity |
|
IdentityDescriptorID
Declaration
public virtual object IdentityDescriptorID { get; }
Property Value
Type |
Description |
System.Object |
|
IdentityDescriptorName
Declaration
public virtual string IdentityDescriptorName { get; }
Property Value
Type |
Description |
System.String |
|
IdentityDescriptorType
Declaration
public virtual IdentityType IdentityDescriptorType { get; }
Property Value
IsAuthenticated
Implementation of IIdentity interface. Checks to see if user is not in invalid status
Declaration
public bool IsAuthenticated { get; }
Property Value
Type |
Description |
System.Boolean |
|
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Rights
Returns data bag that contains user rights. This is a framework-only internal property
which should not be used by application developers. This bag may get populated fully-or-partially
by ISecurityManager implementation. Use User[permission] indexer or Application.SecurityManager.Authorize()
to obtain AccessLevel
Declaration
public Rights Rights { get; }
Property Value
Status
Declaration
public UserStatus Status { get; }
Property Value
StatusTimeStampUTC
Captures timestamp when this user was set to current status (created/set rights)
Security managers may elect to refetch user rights after some period
Declaration
public DateTime StatusTimeStampUTC { get; }
Property Value
Type |
Description |
System.DateTime |
|
Methods
___update_status(UserStatus, String, String, Rights, DateTime)
Framework-internal. Do not call
Declaration
public void ___update_status(UserStatus status, string name, string descr, Rights rights, DateTime utcNow)
Parameters
Type |
Name |
Description |
UserStatus |
status |
|
System.String |
name |
|
System.String |
descr |
|
Rights |
rights |
|
System.DateTime |
utcNow |
|
Invalidate()
Declaration
IsInRole(String)
Determines whether the current principal belongs to the specified role.
This method implements IPrincipal and has little application in Azos framework context
as Azos permissions are more granular than just boolean. This method really checks user kind (User/Admin/Sys).
Confusion comes from the fact that what Microsoft calls role really is just a single named permission -
a role is a named permission set in Azos.
Declaration
public bool IsInRole(string role)
Parameters
Type |
Name |
Description |
System.String |
role |
|
Returns
Type |
Description |
System.Boolean |
|
ToString()
Declaration
public override string ToString()
Returns
Type |
Description |
System.String |
|
Overrides
System.Object.ToString()
Implements
System.Security.Principal.IIdentity
System.Security.Principal.IPrincipal
Extension Methods