mirror of
https://github.com/sbrl/Nibriboard.git
synced 2018-01-10 21:33:49 +00:00
[server] Fix user information deserialisation crash
This commit is contained in:
parent
aacb6f26f9
commit
9137426942
1 changed files with 4 additions and 4 deletions
|
@ -45,14 +45,14 @@ namespace Nibriboard.Userspace
|
|||
[JsonIgnore]
|
||||
public List<RbacRole> Roles { get; set; } = new List<RbacRole>();
|
||||
|
||||
private List<string> rolesText = null;
|
||||
[JsonProperty("RolesText")]
|
||||
[JsonProperty]
|
||||
public List<string> RawRoles { get; set; } = null;
|
||||
public List<string> RolesText {
|
||||
get {
|
||||
return new List<string>(Roles.Select((RbacRole role) => role.Name));
|
||||
}
|
||||
set {
|
||||
rolesText = value;
|
||||
RawRoles = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -97,7 +97,7 @@ namespace Nibriboard.Userspace
|
|||
[OnDeserialized]
|
||||
internal void OnDeserialized(StreamingContext context)
|
||||
{
|
||||
Roles = new List<RbacRole>(userManager.ResolveRoles(rolesText));
|
||||
Roles = new List<RbacRole>(userManager.ResolveRoles(RawRoles));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue