diff options
Diffstat (limited to 'HBContext.cs')
| -rw-r--r-- | HBContext.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/HBContext.cs b/HBContext.cs index 2d44bc5..705efe4 100644 --- a/HBContext.cs +++ b/HBContext.cs @@ -1,18 +1,17 @@ using Microsoft.EntityFrameworkCore; using HyperBooru.Services; +using HyperBooru.PrincipalProviders; namespace HyperBooru; enum HBObjectId { NsfwTag = -1, IngestTag = -2, - AdminUser = -3 } public static class HBObjectGuid { public static readonly Guid NsfwTag = new("EBDAD4F8-455A-4351-8017-1D4854D6FA38"); public static readonly Guid IngestTag = new("EA212801-5BCC-4C0E-814F-FB9D30DB58BC"); - public static readonly Guid AdminUser = new("0623F137-F9D7-456C-A79F-C866B556FBF6"); } public class HBContext : DbContext { @@ -50,7 +49,7 @@ public class HBContext : DbContext { modelBuilder.Entity<Tag>().ToTable("Tags"); modelBuilder.Entity<Media>().ToTable("Media"); modelBuilder.Entity<UploadedFile>().ToTable("UploadedFiles"); - modelBuilder.Entity<Principal>().ToTable("SecurityPrincipals"); + modelBuilder.Entity<LocalPrincipal>().ToTable("SecurityPrincipals"); // Seed internal tag definitions // These should NEVER change @@ -72,11 +71,9 @@ public class HBContext : DbContext { // Seed initial admin user modelBuilder.Entity<LocalUser>().HasData(new LocalUser[] { new() { - ObjectId = (int) HBObjectId.AdminUser, - Guid = HBObjectGuid.AdminUser, Name = "admin", Sid = new SecurityIdentifier("S-1-5-18"), - PasswordHash = UserService.HashPassword("admin") + PasswordHash = LocalPrincipalProvider.HashPassword("admin") } }); |
