diff options
| author | Jake Mannens <jake@asger.xyz> | 2023-09-29 16:20:23 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2023-09-29 16:28:00 +1000 |
| commit | c5ff0b57a12b605a5ae5ae8a92ce7a4e8eaec77a (patch) | |
| tree | a59c3ef10b277a7733a274f107472dc8f00cfc9a /HBContext.cs | |
| parent | 76e4bf609c3d196bd20619188a317fca66f4a04a (diff) | |
Separated HBPrincipal into IPrincipal and LocalPrincipal
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") } }); |
