#2618 - add backward compatibility for permissions optimizations

This commit is contained in:
Shaun Walker
2023-03-02 15:34:42 -05:00
parent 465b7850b7
commit 2b41909d47
48 changed files with 431 additions and 295 deletions

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json;
namespace Oqtane.Models
{
@ -98,7 +99,7 @@ namespace Oqtane.Models
public List<Resource> Resources { get; set; }
[NotMapped]
public List<Permission> Permissions { get; set; }
public List<Permission> PermissionList { get; set; }
[NotMapped]
public Dictionary<string, string> Settings { get; set; }
@ -122,6 +123,18 @@ namespace Oqtane.Models
[NotMapped]
public string LayoutType { get; set; }
[Obsolete("The Permissions property is deprecated. Use PermissionList instead", false)]
[NotMapped]
public string Permissions {
get
{
return JsonSerializer.Serialize(PermissionList);
}
set
{
PermissionList = JsonSerializer.Deserialize<List<Permission>>(Permissions);
}
}
#endregion
}
}