Class User
Represents a user object with extended properties and behavior.
Implements
Inherited Members
Namespace: DataWeb.Identity
Assembly: DataWeb.Core.dll
Syntax
public class User : IUser
Remarks
Initializes a new instance of the User class.
Constructors
User(IUserSettingStore)
Represents a user object with extended properties and behavior.
Declaration
public User(IUserSettingStore userSettingStore)
Parameters
Type | Name | Description |
---|---|---|
IUserSettingStore | userSettingStore | The user setting repository. |
Remarks
Initializes a new instance of the User class.
Properties
Claims
Gets or sets the list of claims for the user.
Declaration
public IEnumerable<Claim> Claims { get; set; }
Property Value
Type | Description |
---|---|
IEnumerable<Claim> |
Culture
Gets or sets the culture code for the user.
Declaration
public string Culture { get; set; }
Property Value
Type | Description |
---|---|
string |
Gets or sets the email address of the user.
Declaration
public string Email { get; set; }
Property Value
Type | Description |
---|---|
string |
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type | Description |
---|---|
string |
Identity
Gets or sets the claims identity of the user.
Declaration
public ClaimsIdentity Identity { get; set; }
Property Value
Type | Description |
---|---|
ClaimsIdentity |
IsAuthenticated
Gets or sets a value indicating whether the user is authenticated.
Declaration
public bool IsAuthenticated { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsDataWeb
Gets or sets a value indicating whether the user is a data web user.
Declaration
public bool IsDataWeb { get; set; }
Property Value
Type | Description |
---|---|
bool |
IsEditable
Gets or sets a value indicating whether the user is editable.
Declaration
public bool IsEditable { get; set; }
Property Value
Type | Description |
---|---|
bool |
PublishMode
Gets or sets the publish mode of the user.
Declaration
public PublishMode PublishMode { get; set; }
Property Value
Type | Description |
---|---|
PublishMode |
Roles
Gets or sets the list of roles for the user.
Declaration
public List<string> Roles { get; set; }
Property Value
Type | Description |
---|---|
List<string> |
UserName
Gets or sets the user name.
Declaration
public string UserName { get; set; }
Property Value
Type | Description |
---|---|
string |
Methods
InitAsync(IIdentity)
Initializes the user object asynchronously using the provided IIdentity.
Declaration
public Task InitAsync(IIdentity identity)
Parameters
Type | Name | Description |
---|---|---|
IIdentity | identity | The identity object to use to initialize the user. |
Returns
Type | Description |
---|---|
Task | A Task representing the asynchronous operation. |
IsInRole(string)
Checks if the user is in the specified role.
Declaration
public bool IsInRole(string roleName)
Parameters
Type | Name | Description |
---|---|---|
string | roleName | The name of the role to check. |
Returns
Type | Description |
---|---|
bool | True if the user is in the specified role, otherwise false. |