1
0
Fork 0

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
1 changed files with 5 additions and 1 deletions

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));