Class WMUser
Class representing users as WMPrincipal instances to which access privileges can be granted, and ownership of objects assigned.
Inherited Members
Namespace: Quantellia.WMServer.Auth
Assembly: WMServer.dll
Syntax
[HasDTO(typeof(WMUserDTO))]
public class WMUser : WMPrincipal, IPolicyAssignable, IDbEntity, IWMEntity
Remarks
For additional properties not related to the security mode, see the UserProfile class.
Constructors
WMUser()
Default constructor that sets the ID to a new GUID.
Declaration
public WMUser()
WMUser(string)
Constructor that initializes the ID.
Declaration
public WMUser(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id |
Properties
Declaration
public string Email { get; set; }
Property Value
Type | Description |
---|---|
string |
Roles
List of roles assigned to the user in the system.
Declaration
public virtual ICollection<UserRole> Roles { get; set; }
Property Value
Type | Description |
---|---|
ICollection<UserRole> |
Methods
Get(string, AuthDbContext?)
Declaration
public static Task<WMUser> Get(string id, AuthDbContext? context = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | |
AuthDbContext | context |
Returns
Type | Description |
---|---|
Task<WMUser> |
HasRole(string)
Tests if this user has been assigned the specified Roles.
Declaration
public bool HasRole(string roleName)
Parameters
Type | Name | Description |
---|---|---|
string | roleName | The name of the role whose assignment to the user is being tested. |
Returns
Type | Description |
---|---|
bool | True if the user has been assigned the role, false otherwise. |