diff --git a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs index b6ba383c4a..6a7ca9ec6d 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs +++ b/modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs @@ -18,12 +18,15 @@ using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AspNetCore.Mvc.UI.Theming; +using Volo.Abp.Authorization.Permissions; using Volo.Abp.Autofac; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Identity; using Volo.Abp.Identity.Web; using Volo.Abp.Modularity; +using Volo.Abp.PermissionManagement; +using Volo.Abp.PermissionManagement.Identity; using Volo.Abp.Threading; using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; @@ -44,6 +47,8 @@ namespace Volo.BloggingTestApp typeof(AbpAccountWebModule), typeof(AbpIdentityWebModule), typeof(AbpIdentityApplicationModule), + typeof(AbpPermissionManagementDomainIdentityModule), + typeof(AbpPermissionManagementApplicationModule), typeof(AbpAutofacModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule) )] @@ -142,15 +147,26 @@ namespace Volo.BloggingTestApp template: "{controller=Home}/{action=Index}/{id?}"); }); - AsyncHelper.RunSync(async () => + + using (var scope = context.ServiceProvider.CreateScope()) { - await context.ServiceProvider - .GetRequiredService() - .SeedAsync( - "1q2w3E*", - IdentityPermissions.GetAll().Union(BloggingPermissions.GetAll()) - ); - }); + AsyncHelper.RunSync(async () => + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync( + "1q2w3E*" + ); + + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync( + RolePermissionValueProvider.ProviderName, + "admin", + IdentityPermissions.GetAll().Union(BloggingPermissions.GetAll()) + ); + }); + } } } } diff --git a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj index 06fd56c1a2..040cfaf4a8 100644 --- a/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj +++ b/modules/blogging/app/Volo.BloggingTestApp/Volo.BloggingTestApp.csproj @@ -31,6 +31,8 @@ + +