diff --git a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Program.cs b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Program.cs index 51d9815..93ca8e1 100644 --- a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Program.cs +++ b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Program.cs @@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using Suspectus.Gandalf.Palantir.Abstractions; using Suspectus.Gandalf.Palantir.Api.Services; -using Suspectus.Gandalf.Palantir.Security.Scheme; using Suspectus.Gandalf.Palantir.Data.Database; using Suspectus.Gandalf.Palantir.Data.Database.Repositories; +using Suspectus.Gandalf.Palantir.Security.Scheme; var builder = WebApplication.CreateBuilder(args); diff --git a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs index a91b7a9..e67534b 100644 --- a/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs +++ b/src/dotnet/Suspectus.Gandalf.Palantir.Api/Services/InitService.cs @@ -9,6 +9,7 @@ using Suspectus.Gandalf.Palantir.Data.Entities.Base; using Suspectus.Gandalf.Palantir.Data.Entities.Subject; using Suspectus.Gandalf.Palantir.Data.Entities.Subject.SignIn; using Suspectus.Gandalf.Palantir.Data.Entities.Tenant; +using Suspectus.Gandalf.Palantir.Data.MasterData; namespace Suspectus.Gandalf.Palantir.Api.Services; @@ -150,9 +151,19 @@ public class InitService """); } + private async Task InitializeMasterAuthorities() + { + var authorities = MasterAuthorities.GetAllAuthorities(); + var roles = MasterRoles.GetAllRoles(); + var groups = MasterGroups.GetAllGroups(); + + //TODO: Add a check to see if the authorities, roles, and groups already exist in the database. + } + public async Task InitializeAsync() { await InitializeDatabaseAsync(); await InitializeMaster(); + await InitializeMasterAuthorities(); } } \ No newline at end of file