1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

Attempt to fix deserialisation issue, but there's still some kind of problem

This commit is contained in:
Starbeamrainbowlabs 2018-01-09 19:50:06 +00:00
parent 10192e88a4
commit aacb6f26f9
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -28,21 +28,25 @@ namespace Nibriboard.Userspace
/// <summary> /// <summary>
/// Represents a single Nibriboard user. /// Represents a single Nibriboard user.
/// </summary> /// </summary>
[JsonObject(MemberSerialization.OptOut)] [JsonObject(MemberSerialization.OptIn)]
public class User public class User
{ {
private static ISimpleHash passwordHasher = new SimpleHash(); private static ISimpleHash passwordHasher = new SimpleHash();
private UserManager userManager; private UserManager userManager;
[JsonProperty]
public DateTime CreationTime { get; set; } public DateTime CreationTime { get; set; }
[JsonProperty]
public string Username { get; set; } public string Username { get; set; }
[JsonProperty]
public string HashedPassword { get; set; } public string HashedPassword { get; set; }
[JsonIgnore] [JsonIgnore]
public List<RbacRole> Roles { get; set; } = new List<RbacRole>(); public List<RbacRole> Roles { get; set; } = new List<RbacRole>();
private List<string> rolesText = null; private List<string> rolesText = null;
[JsonProperty("RolesText")]
public List<string> RolesText { public List<string> RolesText {
get { get {
return new List<string>(Roles.Select((RbacRole role) => role.Name)); return new List<string>(Roles.Select((RbacRole role) => role.Name));