Created AdminContext handling

This commit is contained in:
2024-09-30 19:01:39 +02:00
parent 672f0fd2c3
commit 66ddc22012
33 changed files with 582 additions and 7 deletions

View File

@@ -1,8 +1,11 @@
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using HopFrame.Web.Admin.Attributes;
using HopFrame.Web.Admin.Attributes.Members;
namespace HopFrame.Database.Models;
[AdminDescription("On this page you can manage all user accounts.")]
public class User : IPermissionOwner {
[Key, Required, MinLength(36), MaxLength(36)]
@@ -14,15 +17,16 @@ public class User : IPermissionOwner {
[Required, MaxLength(50), EmailAddress]
public string Email { get; set; }
[Required, MinLength(8), MaxLength(255), JsonIgnore]
[Required, MinLength(8), MaxLength(255), JsonIgnore, AdminIgnore(onlyForListing: true), AdminHideValue]
public string Password { get; set; }
[Required]
[Required, AdminUneditable]
public DateTime CreatedAt { get; set; }
[AdminIgnore(onlyForListing: true)]
public virtual IList<Permission> Permissions { get; set; }
[JsonIgnore]
[JsonIgnore, AdminIgnore]
public virtual IList<Token> Tokens { get; set; }
}