Class User
Represents a user object with extended properties and behavior.
Inheritance
Implements
Inherited Members
Namespace: DataWeb.Identity
Assembly: DataWeb.Core.dll
Syntax
public class User : IUser
Constructors
User(IUserSettingStore)
Initializes a new instance of the User class.
Declaration
public User(IUserSettingStore userSettingRepo)
Parameters
Type | Name | Description |
---|---|---|
IUserSettingStore | userSettingRepo | The user setting repository. |
Properties
Claims
Gets or sets the list of claims for the user.
Declaration
public IEnumerable<Claim> Claims { get; set; }
Property Value
Type |
---|
IEnumerable<Claim> |
Culture
Gets or sets the culture code for the user.
Declaration
public string Culture { get; set; }
Property Value
Type |
---|
string |
Gets or sets the email address of the user.
Declaration
public string Email { get; set; }
Property Value
Type |
---|
string |
Identity
Gets or sets the claims identity of the user.
Declaration
public ClaimsIdentity Identity { get; set; }
Property Value
Type |
---|
ClaimsIdentity |
IdMaster
Gets or sets the unique identifier.
Declaration
public string IdMaster { get; set; }
Property Value
Type |
---|
string |
IsAuthenticated
Gets or sets a value indicating whether the user is authenticated.
Declaration
public bool IsAuthenticated { get; set; }
Property Value
Type |
---|
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 |
---|
bool |
IsEditable
Gets or sets a value indicating whether the user is editable.
Declaration
public bool IsEditable { get; set; }
Property Value
Type |
---|
bool |
PublishMode
Gets or sets the publish mode of the user.
Declaration
public PublishMode PublishMode { get; set; }
Property Value
Type |
---|
PublishMode |
Roles
Gets or sets the list of roles for the user.
Declaration
public List<string> Roles { get; set; }
Property Value
Type |
---|
List<string> |
UserName
Gets or sets the user name.
Declaration
public string UserName { get; set; }
Property Value
Type |
---|
string |
Methods
InitAsync(IIdentity)
Initializes the user object asynchronously using the provided System.Security.Principal.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 System.Threading.Tasks.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. |