exclude legacy Permissions properties from serialization/API payload
This commit is contained in:
@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Oqtane.Models
|
||||
{
|
||||
@ -109,18 +110,19 @@ namespace Oqtane.Models
|
||||
|
||||
#endregion
|
||||
|
||||
#region Deprecated Properties
|
||||
|
||||
[Obsolete("The Permissions property is deprecated. Use PermissionList instead", false)]
|
||||
[NotMapped]
|
||||
[JsonIgnore] // exclude from API payload
|
||||
public string Permissions
|
||||
{
|
||||
get
|
||||
{
|
||||
return JsonSerializer.Serialize(PermissionList);
|
||||
}
|
||||
set
|
||||
{
|
||||
PermissionList = JsonSerializer.Deserialize<List<Permission>>(Permissions);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user