mirror of https://github.com/abpframework/abp.git
csharpabpc-sharpframeworkblazoraspnet-coredotnet-coreaspnetcorearchitecturesaasdomain-driven-designangularmulti-tenancy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
3.1 KiB
73 lines
3.1 KiB
using Localization.Resources.AbpUi;
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Volo.Abp.AspNetCore.Mvc.Localization;
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared;
|
|
using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.Bundling;
|
|
using Volo.Abp.AutoMapper;
|
|
using Volo.Abp.Identity.Localization;
|
|
using Volo.Abp.Identity.Web.Navigation;
|
|
using Volo.Abp.Localization;
|
|
using Volo.Abp.Localization.Resources.AbpValidation;
|
|
using Volo.Abp.Modularity;
|
|
using Volo.Abp.PermissionManagement.Web;
|
|
using Volo.Abp.UI.Navigation;
|
|
using Volo.Abp.VirtualFileSystem;
|
|
|
|
namespace Volo.Abp.Identity.Web
|
|
{
|
|
[DependsOn(typeof(AbpIdentityHttpApiModule))]
|
|
[DependsOn(typeof(AbpAspNetCoreMvcUiBootstrapModule))]
|
|
[DependsOn(typeof(AbpAutoMapperModule))]
|
|
[DependsOn(typeof(AbpPermissionManagementWebModule))]
|
|
[DependsOn(typeof(AbpAspNetCoreMvcUiThemeSharedModule))]
|
|
public class AbpIdentityWebModule : AbpModule
|
|
{
|
|
public override void PreConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
|
|
{
|
|
options.AddAssemblyResource(typeof(IdentityResource), typeof(AbpIdentityWebModule).Assembly);
|
|
});
|
|
}
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context)
|
|
{
|
|
Configure<NavigationOptions>(options =>
|
|
{
|
|
options.MenuContributors.Add(new AbpIdentityWebMainMenuContributor());
|
|
});
|
|
|
|
Configure<VirtualFileSystemOptions>(options =>
|
|
{
|
|
options.FileSets.AddEmbedded<AbpIdentityWebModule>("Volo.Abp.Identity.Web");
|
|
});
|
|
|
|
Configure<AbpAutoMapperOptions>(options =>
|
|
{
|
|
options.AddProfile<AbpIdentityWebAutoMapperProfile>(validate: true);
|
|
});
|
|
|
|
Configure<RazorPagesOptions>(options =>
|
|
{
|
|
options.Conventions.AuthorizePage("/Identity/Users/Index", IdentityPermissions.Users.Default);
|
|
options.Conventions.AuthorizePage("/Identity/Users/CreateModal", IdentityPermissions.Users.Create);
|
|
options.Conventions.AuthorizePage("/Identity/Users/EditModal", IdentityPermissions.Users.Update);
|
|
options.Conventions.AuthorizePage("/Identity/Roles/Index", IdentityPermissions.Roles.Default);
|
|
options.Conventions.AuthorizePage("/Identity/Roles/CreateModal", IdentityPermissions.Roles.Create);
|
|
options.Conventions.AuthorizePage("/Identity/Roles/EditModal", IdentityPermissions.Roles.Update);
|
|
});
|
|
|
|
Configure<BundlingOptions>(options =>
|
|
{
|
|
options
|
|
.ScriptBundles
|
|
.Get(StandardBundles.Scripts.Global)
|
|
.AddFiles("/Pages/Identity/Shared/change-password-modal.js")
|
|
.AddFiles("/Pages/Identity/Shared/personal-settings-modal.js");
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|