using System; using System.Collections.Generic; using System.ComponentModel; using System.Runtime.Serialization; using Umbraco.Core.Models.Membership; namespace Umbraco.Web.Models.ContentEditing { /// /// The user model used for paging and listing users in the UI /// [DataContract(Name = "user", Namespace = "")] [ReadOnly(true)] public class UserBasic : EntityBasic, INotificationModel { public UserBasic() { Notifications = new List(); UserGroups = new List(); } [DataMember(Name = "username")] public string Username { get; set; } /// /// The MD5 lowercase hash of the email which can be used by gravatar /// [DataMember(Name = "emailHash")] public string EmailHash { get; set; } [DataMember(Name = "lastLoginDate")] public DateTime? LastLoginDate { get; set; } /// /// Returns a list of different size avatars /// [DataMember(Name = "avatars")] public string[] Avatars { get; set; } [DataMember(Name = "userState")] public UserState UserState { get; set; } [DataMember(Name = "culture", IsRequired = true)] public string Culture { get; set; } [DataMember(Name = "email", IsRequired = true)] public string Email { get; set; } /// /// The list of group aliases assigned to the user /// [DataMember(Name = "userGroups")] public IEnumerable UserGroups { get; set; } /// /// This is an info flag to denote if this object is the equivalent of the currently logged in user /// [DataMember(Name = "isCurrentUser")] [ReadOnly(true)] public bool IsCurrentUser { get; set; } /// /// This is used to add custom localized messages/strings to the response for the app to use for localized UI purposes. /// [DataMember(Name = "notifications")] public List Notifications { get; private set; } } }