Browse Source

Merge branch 'dev' into ui-extensions-blazor

pull/6647/head
Ilkay Ilknur 5 years ago
parent
commit
7660c8b30e
  1. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json
  2. 4
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json
  3. 5
      abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/zh-Hans.json
  4. 8
      docs/en/Domain-Driven-Design-Implementation-Guide.md
  5. 2
      docs/en/Tutorials/Part-9.md
  6. 8
      docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md
  7. 0
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorGlobalBundles.cs
  8. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/FodyWeavers.xml
  9. 2
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj
  10. 29
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs
  11. 14
      framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js
  12. 2
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs
  13. 17
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeatureActionFilter.cs
  14. 17
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeaturePageFilter.cs
  15. 1
      framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs
  16. 15
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreUnitOfWorkOptions.cs
  17. 42
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs
  18. 15
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpAspNetCoreUnitOfWorkOptions.cs
  19. 20
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs
  20. 142
      framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs
  21. 8
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs
  22. 2
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceServiceTemplateBase.cs
  23. 32
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs
  24. 24
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs
  25. 1
      framework/src/Volo.Abp.Core/Volo/Abp/Aspects/AbpCrossCuttingConcerns.cs
  26. 1
      framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj
  27. 4
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs
  28. 2
      framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs
  29. 7
      framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj
  30. 7
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeatureErrorCodes.cs
  31. 23
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnabledException.cs
  32. 35
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeaturesModule.cs
  33. 14
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureHelper.cs
  34. 28
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptor.cs
  35. 22
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptorRegistrar.cs
  36. 7
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/IGlobalFeatureCheckingEnabled.cs
  37. 10
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/AbpGlobalFeatureResource.cs
  38. 6
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/en.json
  39. 6
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/tr.json
  40. 6
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/zh-Hans.json
  41. 6
      framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/zh-Hant.json
  42. 6
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs
  43. 14
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs
  44. 7
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestPage.cshtml.cs
  45. 18
      framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestPage_Tests.cs
  46. 16
      framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs
  47. 5
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo.Abp.GlobalFeatures.Tests.csproj
  48. 30
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs
  49. 61
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptor_Tests.cs
  50. 12
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureManager_Tests.cs
  51. 12
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureTestBase.cs
  52. 16
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureTestModule.cs
  53. 27
      framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/TestFeature.cs
  54. 2
      modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml
  55. 2
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml
  56. 4
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml
  57. 2
      modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml
  58. 2
      modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs
  59. 4
      modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/fr.json
  60. 2
      modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs
  61. 2
      modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/CmsKitHttpApiHostModule.cs
  62. 2
      modules/cms-kit/host/Volo.CmsKit.IdentityServer/CmsKitIdentityServerModule.cs
  63. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Host/CmsKitWebHostModule.cs
  64. 2
      modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs
  65. 4
      modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs
  66. 2
      modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs
  67. 20
      modules/feature-management/Volo.Abp.FeatureManagement.sln
  68. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/AbpFeatureManagementBlazorServerModule.cs
  69. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/FodyWeavers.xml
  70. 30
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/FodyWeavers.xsd
  71. 18
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/Volo.Abp.FeatureManagement.Blazor.Server.csproj
  72. 14
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/AbpFeatureManagementBlazorWebAssemblyModule.cs
  73. 3
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/FodyWeavers.xml
  74. 30
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/FodyWeavers.xsd
  75. 19
      modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/Volo.Abp.FeatureManagement.Blazor.WebAssembly.csproj
  76. 14
      modules/identity/Volo.Abp.Identity.sln
  77. 15
      modules/identity/src/Volo.Abp.Identity.Blazor.Server/AbpIdentityBlazorServerModule.cs
  78. 3
      modules/identity/src/Volo.Abp.Identity.Blazor.Server/FodyWeavers.xml
  79. 30
      modules/identity/src/Volo.Abp.Identity.Blazor.Server/FodyWeavers.xsd
  80. 19
      modules/identity/src/Volo.Abp.Identity.Blazor.Server/Volo.Abp.Identity.Blazor.Server.csproj
  81. 16
      modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/AbpIdentityBlazorWebAssemblyModule.cs
  82. 3
      modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/FodyWeavers.xml
  83. 30
      modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/FodyWeavers.xsd
  84. 20
      modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/Volo.Abp.Identity.Blazor.WebAssembly.csproj
  85. 9
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeature.cs
  86. 51
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeatureDefinitionProvider.cs
  87. 11
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviour.cs
  88. 23
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviourFeatureHelper.cs
  89. 12
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json
  90. 12
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json
  91. 14
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json
  92. 12
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json
  93. 9
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs
  94. 24
      modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentityTwoFactorBehaviourSettingHelper.cs
  95. 2
      modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj
  96. 17
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs
  97. 70
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityTwoFactorManager.cs
  98. 35
      modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs
  99. 4
      modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs
  100. 14
      modules/permission-management/Volo.Abp.PermissionManagement.sln

4
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/en.json

@ -251,6 +251,8 @@
"AddNoteSuccessMessage": "Note successfully added",
"NameSurname": "Name Surname",
"Note": "Note",
"Add": "Add"
"Add": "Add",
"ProjectDownloads": "Project Downloads",
"ShowProjectDownloadsOfOrganization": "Project Downloads"
}
}

4
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/tr.json

@ -200,6 +200,8 @@
"AddNoteSuccessMessage": "Not başarıyla eklendi",
"NameSurname": "Adı Soyadı",
"Note": "Not",
"Add": "Ekle"
"Add": "Ekle",
"ProjectDownloads": "Proje İndirmeleri",
"ShowProjectDownloadsOfOrganization": "Proje İndirmeleri"
}
}

5
abp_io/AbpIoLocalization/AbpIoLocalization/Admin/Localization/Resources/zh-Hans.json

@ -235,7 +235,8 @@
"AddNoteSuccessMessage": "注释添加成功",
"NameSurname": "姓",
"Note": "注释",
"Add": "添加"
"Add": "添加",
"ProjectDownloads": "项目下载",
"ShowProjectDownloadsOfOrganization": "项目下载"
}
}

8
docs/en/Domain-Driven-Design-Implementation-Guide.md

@ -155,9 +155,9 @@ The projects have been explained before. Now, we can explain the reasons of the
* `Application.Contracts` depends on the `Domain.Shared`. In this way, you can reuse these types in the DTOs. For example, the same `IssueType` enum in the `Domain.Shared` can be used by a `CreateIssueDto` as a property.
* `Application` depends on the `Application.Contracts` since it implements the Application Service interfaces and uses the DTOs inside it. It also depends on the `Domain` since the Application Services are implemented using the Domain Objects defined inside it.
* `EntityFrameworkCore` depends on the `Domain` since it maps the Domain Objects (entities and value types) to database tables (as it is an ORM) and implements the repository interfaces defined in the `Domain`.
* `HttpApi` depends on the `Application.Contacts` since the Controllers inside it inject and use the Application Service interfaces as explained before.
* `HttpApi.Client` depends on the `Application.Contacts` since it can consume the Application Services as explained before.
* `Web` depends on the `HttpApi` since it serves the HTTP APIs defined inside it. Also, in this way, it indirectly depends on the `Application.Contacts` project to consume the Application Services in the Pages/Components.
* `HttpApi` depends on the `Application.Contracts` since the Controllers inside it inject and use the Application Service interfaces as explained before.
* `HttpApi.Client` depends on the `Application.Contracts` since it can consume the Application Services as explained before.
* `Web` depends on the `HttpApi` since it serves the HTTP APIs defined inside it. Also, in this way, it indirectly depends on the `Application.Contracts` project to consume the Application Services in the Pages/Components.
#### Dashed Dependencies
@ -1801,7 +1801,7 @@ Such a design makes it even more important to distinguish between Domain logic a
To be more clear about the implementation, you can create different projects (`.csproj`) for each application types. For example;
* `IssueTracker.Admin.Application` & `IssueTracker.Admin.Application.Contacts` projects for the Back Office (admin) Application.
* `IssueTracker.Admin.Application` & `IssueTracker.Admin.Application.Contracts` projects for the Back Office (admin) Application.
* `IssueTracker.Public.Application` & `IssueTracker.Public.Application.Contracts` projects for the Public Web Application.
* `IssueTracker.Mobile.Application` & `IssueTracker.Mobile.Application.Contracts` projects for the Mobile Application.

2
docs/en/Tutorials/Part-9.md

@ -1116,7 +1116,7 @@ namespace Acme.BookStore.Blazor.Pages
await GetAuthorsAsync();
StateHasChanged();
await InvokeAsync(StateHasChanged);
}
private void OpenCreateAuthorModal()

8
docs/zh-Hans/Domain-Driven-Design-Implementation-Guide.md

@ -153,9 +153,9 @@ ABP的启动解决方案中包含两个用于集成Entity Framework Core的项
* `Application.Contracts` 依赖`Domain.Shared`项目,可以在DTO中重用`Domain.Shared`中的类型.例如,`Domain.Shared`项目中的枚举类型 `IssueType` 同样被`Contracts`项目中的`CreateIssueDto`DTO所引用.
* `Application` 依赖`Application.Contracts`项目,因为此项目需要实现应用服务的接口及接口使用的DTO.另外也依赖`Domain`项目,因为应用服务的实现必须依赖领域层中的对象.
* `EntityFrameworkCore` 依赖`Domain`项目,因为此项目需要将领域对象(实体或值对象)映射到数据库的表,另外还需要实现`Domain`项目中的仓储接口.
* `HttpApi` 依赖`Application.Contacts`项目,因为Controllers需要注入应用服务.
* `HttpApi.Client` 依赖`Application.Contacts`项目,因为此项目需要是使用应用服务.
* `Web` 依赖`HttpApi`项目,因为此项目对外提供HTTP APIs.另外Pages或Components 需要使用应用服务,所以还间接依赖了`Application.Contacts`项目
* `HttpApi` 依赖`Application.Contracts`项目,因为Controllers需要注入应用服务.
* `HttpApi.Client` 依赖`Application.Contracts`项目,因为此项目需要是使用应用服务.
* `Web` 依赖`HttpApi`项目,因为此项目对外提供HTTP APIs.另外Pages或Components 需要使用应用服务,所以还间接依赖了`Application.Contracts`项目
#### 虚线依赖
@ -1798,7 +1798,7 @@ public async Task ChangeTitleAsync(Issue issue, string title)
为了更清楚的实现,你可以为不同的应用类型创建不同的项目(`.csproj`):
* `IssueTracker.Admin.Application``IssueTracker.Admin.Application.Contacts` 为后台管理系统提供服务.
* `IssueTracker.Admin.Application``IssueTracker.Admin.Application.Contracts` 为后台管理系统提供服务.
* `IssueTracker.Public.Application``IssueTracker.Public.Application.Contracts` 为公开网站提供服务.
* `IssueTracker.Mobile.Application``IssueTracker.Mobile.Application.Contracts` 为移动端应用提供服务.

0
framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Bundling/BlazorGlobalBundles.cs → framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorGlobalBundles.cs

2
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/FodyWeavers.xml

@ -1,3 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

2
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo.Abp.AspNetCore.Components.Server.csproj

@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" />
<ProjectReference Include="..\Volo.Abp.AspNetCore.SignalR\Volo.Abp.AspNetCore.SignalR.csproj" />
</ItemGroup>
</Project>

29
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs

@ -1,17 +1,42 @@
using Microsoft.Extensions.DependencyInjection;
using System.Collections.Generic;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;
using Volo.Abp.AspNetCore.Auditing;
using Volo.Abp.AspNetCore.SignalR;
using Volo.Abp.AspNetCore.Uow;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.Server
{
[DependsOn(
typeof(AbpAspNetCoreModule)
typeof(AbpAspNetCoreSignalRModule)
)]
public class AbpAspNetCoreComponentsServerModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddServerSideBlazor();
Configure<AbpAspNetCoreUnitOfWorkOptions>(options =>
{
options.IgnoredUrls.AddIfNotContains("/_blazor");
});
Configure<AbpAspNetCoreAuditingOptions>(options =>
{
options.IgnoredUrls.AddIfNotContains("/_blazor");
});
Configure<AbpEndpointRouterOptions>(options =>
{
options.EndpointConfigureActions.Add(endpointContext =>
{
endpointContext.Endpoints.MapBlazorHub();
endpointContext.Endpoints.MapFallbackToPage("/_Host");
});
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)

14
framework/src/Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared/wwwroot/libs/abp/aspnetcore-mvc-ui-theme-shared/datatables/datatables-extensions.js

@ -1,4 +1,4 @@
var abp = abp || {};
var abp = abp || {};
(function ($) {
var datatables = abp.utils.createNamespace(abp, 'libs.datatables');
@ -78,7 +78,7 @@
return "";
}
var $button = $('<button type="button" class="btn btn-primary"></button>');
var $button = $('<button type="button" class="btn btn-primary abp-action-button"></button>');
if (firstItem.displayNameHtml) {
$button.html(firstItem.text);
@ -119,7 +119,7 @@
var $container = $('<div/>')
.addClass('dropdown')
.addClass('action-button');
.addClass('abp-action-button');
var $dropdownButton = $('<button/>');
@ -236,9 +236,9 @@
var $actionContainer = _createRowAction(aData, column.rowAction, tableInstance);
hideEmptyColumn($actionContainer, tableInstance, colIndex);
var $actionButton = $(cells[colIndex]).find(".action-button");
var $actionButton = $(cells[colIndex]).find(".abp-action-button");
if ($actionButton.length === 0) {
$(cells[colIndex]).append($actionContainer);
$(cells[colIndex]).empty().append($actionContainer);
}
}
}
@ -408,6 +408,10 @@
}
}
if (!column.render) {
column.render = $.fn.dataTable.render.text();
}
if (column.rowAction) {
customizeRowActionColumn(column);
}

2
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Auditing/AbpAuditPageFilter.cs

@ -83,7 +83,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
auditLog = auditLogScope.Log;
auditLogAction = auditingHelper.CreateAuditLogAction(
auditLog,
context.HandlerMethod.GetType(),
context.HandlerMethod.MethodInfo.DeclaringType,
context.HandlerMethod.MethodInfo,
context.HandlerArguments
);

17
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeatureActionFilter.cs

@ -1,13 +1,13 @@
using System;
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Reflection;
namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
{
@ -21,7 +21,7 @@ namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
return;
}
if (!IsGlobalFeatureEnabled(context.Controller.GetType(), out var attribute))
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(context.Controller.GetType(), out var attribute))
{
var logger = context.GetService<ILogger<GlobalFeatureActionFilter>>(NullLogger<GlobalFeatureActionFilter>.Instance);
logger.LogWarning($"The '{context.Controller.GetType().FullName}' controller needs to enable '{attribute.Name}' feature.");
@ -29,13 +29,10 @@ namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
return;
}
await next();
}
protected virtual bool IsGlobalFeatureEnabled(Type controllerType, out RequiresGlobalFeatureAttribute attribute)
{
attribute = ReflectionHelper.GetSingleAttributeOrDefault<RequiresGlobalFeatureAttribute>(controllerType);
return attribute == null || GlobalFeatureManager.Instance.IsEnabled(attribute.GetFeatureName());
using (AbpCrossCuttingConcerns.Applying(context.Controller, AbpCrossCuttingConcerns.GlobalFeatureChecking))
{
await next();
}
}
}
}

17
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/GlobalFeatures/GlobalFeaturePageFilter.cs

@ -1,13 +1,13 @@
using System;
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Abstractions;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Reflection;
namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
{
@ -26,7 +26,7 @@ namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
return;
}
if (!IsGlobalFeatureEnabled(context.HandlerInstance.GetType(), out var attribute))
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(context.HandlerInstance.GetType(), out var attribute))
{
var logger = context.GetService<ILogger<GlobalFeatureActionFilter>>(NullLogger<GlobalFeatureActionFilter>.Instance);
logger.LogWarning($"The '{context.HandlerInstance.GetType().FullName}' page needs to enable '{attribute.Name}' feature.");
@ -34,13 +34,10 @@ namespace Volo.Abp.AspNetCore.Mvc.GlobalFeatures
return;
}
await next();
}
protected virtual bool IsGlobalFeatureEnabled(Type controllerType, out RequiresGlobalFeatureAttribute attribute)
{
attribute = ReflectionHelper.GetSingleAttributeOrDefault<RequiresGlobalFeatureAttribute>(controllerType);
return attribute == null || GlobalFeatureManager.Instance.IsEnabled(attribute.GetFeatureName());
using (AbpCrossCuttingConcerns.Applying(context.HandlerInstance, AbpCrossCuttingConcerns.GlobalFeatureChecking))
{
await next();
}
}
}
}

1
framework/src/Volo.Abp.AspNetCore.SignalR/Volo/Abp/AspNetCore/SignalR/AbpHub.cs

@ -1,7 +1,6 @@
using System;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;

15
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAspNetCoreUnitOfWorkOptions.cs

@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Auditing
{
public class AbpAspNetCoreAuditingOptions
{
/// <summary>
/// This is used to disable the <see cref="AbpAuditingMiddleware"/>,
/// app.UseAuditing(), for the specified URLs.
/// <see cref="AbpAuditingMiddleware"/> will be disabled for URLs
/// starting with an ignored URL.
/// </summary>
public List<string> IgnoredUrls { get; } = new List<string>();
}
}

42
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Auditing/AbpAuditingMiddleware.cs

@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
@ -12,29 +13,39 @@ namespace Volo.Abp.AspNetCore.Auditing
public class AbpAuditingMiddleware : IMiddleware, ITransientDependency
{
private readonly IAuditingManager _auditingManager;
protected AbpAuditingOptions Options { get; }
protected AbpAuditingOptions AuditingOptions { get; }
protected AbpAspNetCoreAuditingOptions AspNetCoreAuditingOptions { get; }
protected ICurrentUser CurrentUser { get; }
public AbpAuditingMiddleware(
IAuditingManager auditingManager,
ICurrentUser currentUser,
IOptions<AbpAuditingOptions> options)
IOptions<AbpAuditingOptions> auditingOptions,
IOptions<AbpAspNetCoreAuditingOptions> aspNetCoreAuditingOptions)
{
_auditingManager = auditingManager;
CurrentUser = currentUser;
Options = options.Value;
AuditingOptions = auditingOptions.Value;
AspNetCoreAuditingOptions = aspNetCoreAuditingOptions.Value;
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
bool hasError = false;
using (var scope = _auditingManager.BeginScope())
if (!AuditingOptions.IsEnabled || IsIgnoredUrl(context))
{
await next(context);
return;
}
var hasError = false;
using (var saveHandle = _auditingManager.BeginScope())
{
try
{
await next(context);
Debug.Assert(_auditingManager.Current != null);
if (_auditingManager.Current.Log.Exceptions.Any())
{
hasError = true;
@ -49,30 +60,31 @@ namespace Volo.Abp.AspNetCore.Auditing
{
if (ShouldWriteAuditLog(context, hasError))
{
await scope.SaveAsync();
await saveHandle.SaveAsync();
}
}
}
}
private bool ShouldWriteAuditLog(HttpContext httpContext, bool hasError = false)
private bool IsIgnoredUrl(HttpContext context)
{
if (!Options.IsEnabled)
{
return false;
}
return context.Request.Path.Value != null &&
AspNetCoreAuditingOptions.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x));
}
if (Options.AlwaysLogOnException && hasError)
private bool ShouldWriteAuditLog(HttpContext httpContext, bool hasError)
{
if (AuditingOptions.AlwaysLogOnException && hasError)
{
return true;
}
if (!Options.IsEnabledForAnonymousUsers && !CurrentUser.IsAuthenticated)
if (!AuditingOptions.IsEnabledForAnonymousUsers && !CurrentUser.IsAuthenticated)
{
return false;
}
if (!Options.IsEnabledForGetRequests &&
if (!AuditingOptions.IsEnabledForGetRequests &&
string.Equals(httpContext.Request.Method, HttpMethods.Get, StringComparison.OrdinalIgnoreCase))
{
return false;

15
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpAspNetCoreUnitOfWorkOptions.cs

@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace Volo.Abp.AspNetCore.Uow
{
public class AbpAspNetCoreUnitOfWorkOptions
{
/// <summary>
/// This is used to disable the <see cref="AbpUnitOfWorkMiddleware"/>,
/// app.UseUnitOfWork(), for the specified URLs.
/// <see cref="AbpUnitOfWorkMiddleware"/> will be disabled for URLs
/// starting with an ignored URL.
/// </summary>
public List<string> IgnoredUrls { get; } = new List<string>();
}
}

20
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs

@ -1,5 +1,7 @@
using System.Threading.Tasks;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Uow;
@ -8,17 +10,19 @@ namespace Volo.Abp.AspNetCore.Uow
public class AbpUnitOfWorkMiddleware : IMiddleware, ITransientDependency
{
private readonly IUnitOfWorkManager _unitOfWorkManager;
private readonly AbpAspNetCoreUnitOfWorkOptions _options;
public AbpUnitOfWorkMiddleware(IUnitOfWorkManager unitOfWorkManager)
public AbpUnitOfWorkMiddleware(
IUnitOfWorkManager unitOfWorkManager,
IOptions<AbpAspNetCoreUnitOfWorkOptions> options)
{
_unitOfWorkManager = unitOfWorkManager;
_options = options.Value;
}
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
{
//TODO: Make this configurable.
if (context.Request.Path.Value != null &&
context.Request.Path.Value.StartsWith("/_blazor"))
if (IsIgnoredUrl(context))
{
await next(context);
return;
@ -30,5 +34,11 @@ namespace Volo.Abp.AspNetCore.Uow
await uow.CompleteAsync(context.RequestAborted);
}
}
private bool IsIgnoredUrl(HttpContext context)
{
return context.Request.Path.Value != null &&
_options.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x));
}
}
}

142
framework/src/Volo.Abp.Auditing/Volo/Abp/Auditing/AuditingInterceptor.cs

@ -1,10 +1,13 @@
using System;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
using Volo.Abp.Users;
namespace Volo.Abp.Auditing
{
@ -19,12 +22,65 @@ namespace Volo.Abp.Auditing
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
if (!ShouldIntercept(invocation, out var auditLog, out var auditLogAction))
using (var serviceScope = _serviceScopeFactory.CreateScope())
{
await invocation.ProceedAsync();
return;
var auditingHelper = serviceScope.ServiceProvider.GetRequiredService<IAuditingHelper>();
var auditingOptions = serviceScope.ServiceProvider.GetRequiredService<IOptions<AbpAuditingOptions>>().Value;
if (!ShouldIntercept(invocation, auditingOptions, auditingHelper))
{
await invocation.ProceedAsync();
return;
}
var auditingManager = serviceScope.ServiceProvider.GetRequiredService<IAuditingManager>();
if (auditingManager.Current != null)
{
await ProceedByLoggingAsync(invocation, auditingHelper, auditingManager.Current);
}
else
{
var currentUser = serviceScope.ServiceProvider.GetRequiredService<ICurrentUser>();
await ProcessWithNewAuditingScopeAsync(invocation, auditingOptions, currentUser, auditingManager, auditingHelper);
}
}
}
protected virtual bool ShouldIntercept(IAbpMethodInvocation invocation,
AbpAuditingOptions options,
IAuditingHelper auditingHelper)
{
if (!options.IsEnabled)
{
return false;
}
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Auditing))
{
return false;
}
if (!auditingHelper.ShouldSaveAudit(invocation.Method))
{
return false;
}
return true;
}
private static async Task ProceedByLoggingAsync(
IAbpMethodInvocation invocation,
IAuditingHelper auditingHelper,
IAuditLogScope auditLogScope)
{
var auditLog = auditLogScope.Log;
var auditLogAction = auditingHelper.CreateAuditLogAction(
auditLog,
invocation.TargetObject.GetType(),
invocation.Method,
invocation.Arguments
);
var stopwatch = Stopwatch.StartNew();
try
@ -43,45 +99,65 @@ namespace Volo.Abp.Auditing
auditLog.Actions.Add(auditLogAction);
}
}
protected virtual bool ShouldIntercept(
IAbpMethodInvocation invocation,
out AuditLogInfo auditLog,
out AuditLogActionInfo auditLogAction)
private async Task ProcessWithNewAuditingScopeAsync(
IAbpMethodInvocation invocation,
AbpAuditingOptions options,
ICurrentUser currentUser,
IAuditingManager auditingManager,
IAuditingHelper auditingHelper)
{
auditLog = null;
auditLogAction = null;
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.Auditing))
var hasError = false;
using (var saveHandle = auditingManager.BeginScope())
{
return false;
}
try
{
await ProceedByLoggingAsync(invocation, auditingHelper, auditingManager.Current);
using (var scope = _serviceScopeFactory.CreateScope())
{
var auditingManager = scope.ServiceProvider.GetRequiredService<IAuditingManager>();
var auditLogScope = auditingManager.Current;
if (auditLogScope == null)
Debug.Assert(auditingManager.Current != null);
if (auditingManager.Current.Log.Exceptions.Any())
{
hasError = true;
}
}
catch (Exception)
{
return false;
hasError = true;
throw;
}
var auditingHelper = scope.ServiceProvider.GetRequiredService<IAuditingHelper>();
if (!auditingHelper.ShouldSaveAudit(invocation.Method))
finally
{
return false;
if (ShouldWriteAuditLog(invocation, options, currentUser, hasError))
{
await saveHandle.SaveAsync();
}
}
}
}
private bool ShouldWriteAuditLog(
IAbpMethodInvocation invocation,
AbpAuditingOptions options,
ICurrentUser currentUser,
bool hasError)
{
if (options.AlwaysLogOnException && hasError)
{
return true;
}
auditLog = auditLogScope.Log;
auditLogAction = auditingHelper.CreateAuditLogAction(
auditLog,
invocation.TargetObject.GetType(),
invocation.Method,
invocation.Arguments
);
if (!options.IsEnabledForAnonymousUsers && !currentUser.IsAuthenticated)
{
return false;
}
return true;
if (!options.IsEnabledForGetRequests &&
invocation.Method.Name.StartsWith("Get",StringComparison.OrdinalIgnoreCase))
{
return false;
}
return true;
}
}
}
}

8
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Commands/NewCommand.cs

@ -274,14 +274,18 @@ namespace Volo.Abp.Cli.Commands
private UiFramework FindMicroserviceSolutionUiFramework(string outputFolderRoot)
{
if (Directory.Exists(Path.Combine(outputFolderRoot, "applications", "blazor")))
if (Directory.Exists(Path.Combine(outputFolderRoot, "apps", "blazor")))
{
return UiFramework.Blazor;
}
if (Directory.Exists(Path.Combine(outputFolderRoot, "applications", "web")))
if (Directory.Exists(Path.Combine(outputFolderRoot, "apps", "web")))
{
return UiFramework.Mvc;
}
if (Directory.Exists(Path.Combine(outputFolderRoot, "apps", "angular")))
{
return UiFramework.Angular;
}
return UiFramework.None;
}

2
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceServiceTemplateBase.cs

@ -23,7 +23,7 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
{
serviceName = serviceName.ToCamelCase().RemovePostFix("Service");
return Path.Combine(mainSolutionFolder, "microservices", serviceName);
return Path.Combine(mainSolutionFolder, "services", serviceName);
}
public override IEnumerable<ProjectBuildPipelineStep> GetCustomSteps(ProjectBuildContext context)

32
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectBuilding/Templates/Microservice/MicroserviceTemplateBase.cs

@ -34,37 +34,37 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
{
case UiFramework.None:
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web",null,
"/applications/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/applications/web"));
"/apps/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/apps/web"));
steps.Add(new RemoveProjectFromTyeStep("web"));
steps.Add(new RemoveProjectFromPrometheusStep("web"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor",null,
"/applications/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/applications/blazor"));
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
steps.Add(new RemoveProjectFromTyeStep("blazor"));
steps.Add(new RemoveFolderStep("/angular"));
steps.Add(new RemoveFolderStep("/apps/angular"));
break;
case UiFramework.Angular:
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web",null,
"/applications/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/applications/web"));
"/apps/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/apps/web"));
steps.Add(new RemoveProjectFromTyeStep("web"));
steps.Add(new RemoveProjectFromPrometheusStep("web"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor",null,
"/applications/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/applications/blazor"));
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
steps.Add(new RemoveProjectFromTyeStep("blazor"));
break;
case UiFramework.Blazor:
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web",null,
"/applications/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/applications/web"));
steps.Add(new RemoveFolderStep("/angular"));
"/apps/web/src/MyCompanyName.MyProjectName.Web"));
steps.Add(new RemoveFolderStep("/apps/web"));
steps.Add(new RemoveFolderStep("/apps/angular"));
steps.Add(new RemoveProjectFromTyeStep("web"));
steps.Add(new RemoveProjectFromPrometheusStep("web"));
break;
@ -72,15 +72,15 @@ namespace Volo.Abp.Cli.ProjectBuilding.Templates.Microservice
case UiFramework.Mvc:
case UiFramework.NotSpecified:
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Blazor",null,
"/applications/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/applications/blazor"));
"/apps/blazor/src/MyCompanyName.MyProjectName.Blazor"));
steps.Add(new RemoveFolderStep("/apps/blazor"));
steps.Add(new RemoveProjectFromTyeStep("blazor"));
steps.Add(new RemoveFolderStep("/angular"));
steps.Add(new RemoveFolderStep("/apps/angular"));
break;
}
steps.Add(new RemoveFolderStep("/microservices/template"));
steps.Add(new RemoveFolderStep("/services/template"));
}
private static void RandomizeStringEncryption(ProjectBuildContext context, List<ProjectBuildPipelineStep> steps)

24
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/ProjectModification/SolutionModuleAdder.cs

@ -1,4 +1,5 @@
using JetBrains.Annotations;
using System;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.Collections.Generic;
@ -174,6 +175,7 @@ namespace Volo.Abp.Cli.ProjectModification
{
await RemoveProjectByTarget(module, moduleSolutionFile, NuGetPackageTarget.EntityFrameworkCore, isProjectTiered);
await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".EntityFrameworkCore.Tests");
await RemoveProjectByPostFix(module, moduleSolutionFile, "test", ".Application.Tests");
ChangeDomainTestReferenceToMongoDB(module, moduleSolutionFile);
}
}
@ -214,18 +216,16 @@ namespace Volo.Abp.Cli.ProjectModification
return;
}
var projectFolderPath = Directory.GetDirectories(srcPath).FirstOrDefault(d => d.EndsWith(postFix));
var projectFolderPaths = Directory.GetDirectories(srcPath).Where(d => d.EndsWith(postFix)).ToList();
if (projectFolderPath == null)
foreach (var projectFolderPath in projectFolderPaths)
{
return;
}
await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, new DirectoryInfo(projectFolderPath).Name);
await SolutionFileModifier.RemoveProjectFromSolutionFileAsync(moduleSolutionFile, new DirectoryInfo(projectFolderPath).Name);
if (Directory.Exists(projectFolderPath))
{
Directory.Delete(projectFolderPath, true);
if (Directory.Exists(projectFolderPath))
{
Directory.Delete(projectFolderPath, true);
}
}
}
@ -245,8 +245,8 @@ namespace Volo.Abp.Cli.ProjectModification
return;
}
var csprojFile = Directory.GetFiles(projectFolderPath).FirstOrDefault(p => p.EndsWith(".csproj"));
var moduleFile = Directory.GetFiles(projectFolderPath).FirstOrDefault(p => p.EndsWith("DomainTestModule.cs"));
var csprojFile = Directory.GetFiles(projectFolderPath, "*.csproj", SearchOption.AllDirectories).FirstOrDefault();
var moduleFile = Directory.GetFiles(projectFolderPath, "*DomainTestModule.cs", SearchOption.AllDirectories).FirstOrDefault();
if (csprojFile == null || moduleFile == null)
{

1
framework/src/Volo.Abp.Core/Volo/Abp/Aspects/AbpCrossCuttingConcerns.cs

@ -11,6 +11,7 @@ namespace Volo.Abp.Aspects
public const string Auditing = "AbpAuditing";
public const string UnitOfWork = "AbpUnitOfWork";
public const string FeatureChecking = "AbpFeatureChecking";
public const string GlobalFeatureChecking = "AbpGlobalFeatureChecking";
public static void AddApplied(object obj, params string[] concerns)
{

1
framework/src/Volo.Abp.Ddd.Application/Volo.Abp.Ddd.Application.csproj

@ -19,6 +19,7 @@
<ProjectReference Include="..\Volo.Abp.Ddd.Application.Contracts\Volo.Abp.Ddd.Application.Contracts.csproj" />
<ProjectReference Include="..\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
<ProjectReference Include="..\Volo.Abp.Features\Volo.Abp.Features.csproj" />
<ProjectReference Include="..\Volo.Abp.GlobalFeatures\Volo.Abp.GlobalFeatures.csproj" />
<ProjectReference Include="..\Volo.Abp.Http.Abstractions\Volo.Abp.Http.Abstractions.csproj" />
<ProjectReference Include="..\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
<ProjectReference Include="..\Volo.Abp.ObjectMapping\Volo.Abp.ObjectMapping.csproj" />

4
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs

@ -3,6 +3,7 @@ using Volo.Abp.Application.Services;
using Volo.Abp.Authorization;
using Volo.Abp.Domain;
using Volo.Abp.Features;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Http;
using Volo.Abp.Http.Modeling;
using Volo.Abp.Modularity;
@ -23,7 +24,8 @@ namespace Volo.Abp.Application
typeof(AbpAuthorizationModule),
typeof(AbpHttpAbstractionsModule),
typeof(AbpSettingsModule),
typeof(AbpFeaturesModule)
typeof(AbpFeaturesModule),
typeof(AbpGlobalFeaturesModule)
)]
public class AbpDddApplicationModule : AbpModule
{

2
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/ApplicationService.cs

@ -12,6 +12,7 @@ using Volo.Abp.Auditing;
using Volo.Abp.Authorization;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.GlobalFeatures;
using Volo.Abp.Guids;
using Volo.Abp.Linq;
using Volo.Abp.Localization;
@ -31,6 +32,7 @@ namespace Volo.Abp.Application.Services
IValidationEnabled,
IUnitOfWorkEnabled,
IAuditingEnabled,
IGlobalFeatureCheckingEnabled,
ITransientDependency
{
public IAbpLazyServiceProvider LazyServiceProvider { get; set; }

7
framework/src/Volo.Abp.GlobalFeatures/Volo.Abp.GlobalFeatures.csproj

@ -14,8 +14,15 @@
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="Volo\Abp\GlobalFeatures\Localization\*.json" />
<EmbeddedResource Include="Volo\Abp\GlobalFeatures\Localization\*.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Core\Volo.Abp.Core.csproj" />
<ProjectReference Include="..\Volo.Abp.Localization\Volo.Abp.Localization.csproj" />
<ProjectReference Include="..\Volo.Abp.VirtualFileSystem\Volo.Abp.VirtualFileSystem.csproj" />
</ItemGroup>
</Project>

7
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeatureErrorCodes.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.GlobalFeatures
{
public class AbpGlobalFeatureErrorCodes
{
public const string GlobalFeatureIsNotEnabled = "Volo.GlobalFeature:010001";
}
}

23
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnabledException.cs

@ -0,0 +1,23 @@
using System;
using Volo.Abp.ExceptionHandling;
namespace Volo.Abp.GlobalFeatures
{
[Serializable]
public class AbpGlobalFeatureNotEnabledException : AbpException, IHasErrorCode
{
public string Code { get; }
public AbpGlobalFeatureNotEnabledException(string message = null, string code = null, Exception innerException = null)
: base(message, innerException)
{
Code = code;
}
public AbpGlobalFeatureNotEnabledException WithData(string name, object value)
{
Data[name] = value;
return this;
}
}
}

35
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/AbpGlobalFeaturesModule.cs

@ -1,9 +1,42 @@
using Volo.Abp.Modularity;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.GlobalFeatures.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Localization.ExceptionHandling;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace Volo.Abp.GlobalFeatures
{
[DependsOn(
typeof(AbpLocalizationModule),
typeof(AbpVirtualFileSystemModule)
)]
public class AbpGlobalFeaturesModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
context.Services.OnRegistred(GlobalFeatureInterceptorRegistrar.RegisterIfNeeded);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpGlobalFeatureResource>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Add<AbpGlobalFeatureResource>("en")
.AddVirtualJson("/Volo/Abp/GlobalFeatures/Localization");
});
Configure<AbpExceptionLocalizationOptions>(options =>
{
options.MapCodeNamespace("Volo.GlobalFeature", typeof(AbpGlobalFeatureResource));
});
}
}
}

14
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureHelper.cs

@ -0,0 +1,14 @@
using System;
using Volo.Abp.Reflection;
namespace Volo.Abp.GlobalFeatures
{
public static class GlobalFeatureHelper
{
public static bool IsGlobalFeatureEnabled(Type type, out RequiresGlobalFeatureAttribute attribute)
{
attribute = ReflectionHelper.GetSingleAttributeOrDefault<RequiresGlobalFeatureAttribute>(type);
return attribute == null || GlobalFeatureManager.Instance.IsEnabled(attribute.GetFeatureName());
}
}
}

28
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptor.cs

@ -0,0 +1,28 @@
using System.Threading.Tasks;
using Volo.Abp.Aspects;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
namespace Volo.Abp.GlobalFeatures
{
public class GlobalFeatureInterceptor : AbpInterceptor, ITransientDependency
{
public override async Task InterceptAsync(IAbpMethodInvocation invocation)
{
if (AbpCrossCuttingConcerns.IsApplied(invocation.TargetObject, AbpCrossCuttingConcerns.GlobalFeatureChecking))
{
await invocation.ProceedAsync();
return;
}
if (!GlobalFeatureHelper.IsGlobalFeatureEnabled(invocation.TargetObject.GetType(), out var attribute))
{
throw new AbpGlobalFeatureNotEnabledException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
.WithData("ServiceName", invocation.TargetObject.GetType().FullName)
.WithData("GlobalFeatureName", attribute.Name);
}
await invocation.ProceedAsync();
}
}
}

22
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptorRegistrar.cs

@ -0,0 +1,22 @@
using System;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DynamicProxy;
namespace Volo.Abp.GlobalFeatures
{
public static class GlobalFeatureInterceptorRegistrar
{
public static void RegisterIfNeeded(IOnServiceRegistredContext context)
{
if (ShouldIntercept(context.ImplementationType))
{
context.Interceptors.TryAdd<GlobalFeatureInterceptor>();
}
}
private static bool ShouldIntercept(Type type)
{
return !DynamicProxyIgnoreTypes.Contains(type) && typeof(IGlobalFeatureCheckingEnabled).IsAssignableFrom(type);
}
}
}

7
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/IGlobalFeatureCheckingEnabled.cs

@ -0,0 +1,7 @@
namespace Volo.Abp.GlobalFeatures
{
public interface IGlobalFeatureCheckingEnabled
{
}
}

10
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/AbpGlobalFeatureResource.cs

@ -0,0 +1,10 @@
using Volo.Abp.Localization;
namespace Volo.Abp.GlobalFeatures.Localization
{
[LocalizationResourceName("AbpGlobalFeature")]
public class AbpGlobalFeatureResource
{
}
}

6
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"Volo.GlobalFeature:010001": "The '{ServiceName}' service needs to enable '{GlobalFeatureName}' feature."
}
}

6
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/tr.json

@ -0,0 +1,6 @@
{
"culture": "tr",
"texts": {
"Volo.GlobalFeature:010001": "'{ServiceName}' hizmetinin '{GlobalFeatureName}' özelliğini etkinleştirmesi gerekiyor."
}
}

6
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"Volo.GlobalFeature:010001": "'{ServiceName}'服务需要启用'{GlobalFeatureName}'功能."
}
}

6
framework/src/Volo.Abp.GlobalFeatures/Volo/Abp/GlobalFeatures/Localization/zh-Hant.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hant",
"texts": {
"Volo.GlobalFeature:010001": "'{ServiceName}'服務需要啟用'{GlobalFeatureName}'功能."
}
}

6
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController.cs

@ -14,6 +14,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
_options = options.Value;
}
[HttpGet]
public IActionResult Get()
{
return Ok();
}
[Route("audit-success")]
public IActionResult AuditSuccessForGetRequests()
{

14
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestController_Tests.cs

@ -1,4 +1,5 @@
using System;
using System.Linq;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
@ -28,6 +29,17 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
base.ConfigureServices(context, services);
}
[Fact]
public async Task Should_Get_Correct_ServiceName_And_MethodName()
{
_options.IsEnabledForGetRequests = true;
_options.AlwaysLogOnException = false;
await GetResponseAsync("/api/audit-test/");
await _auditingStore.Received().SaveAsync(Arg.Is<AuditLogInfo>(x =>
x.Actions.Any(a => a.ServiceName == typeof(AuditTestController).FullName) &&
x.Actions.Any(a => a.MethodName == nameof(AuditTestController.Get))));
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Success_For_GetRequests()
{
@ -51,7 +63,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Exception_When_Returns_Object()
{

7
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestPage.cshtml.cs

@ -15,6 +15,11 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
_options = options.Value;
}
public void OnGet()
{
}
public IActionResult OnGetAuditSuccessForGetRequests()
{
return new OkResult();
@ -30,4 +35,4 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
throw new UserFriendlyException("Exception occurred!");
}
}
}
}

18
framework/test/Volo.Abp.AspNetCore.Mvc.Tests/Volo/Abp/AspNetCore/Mvc/Auditing/AuditTestPage_Tests.cs

@ -1,4 +1,5 @@
using System.Threading.Tasks;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Hosting;
@ -27,6 +28,17 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
base.ConfigureServices(context, services);
}
[Fact]
public async Task Should_Get_Correct_ServiceName_And_MethodName()
{
_options.IsEnabledForGetRequests = true;
_options.AlwaysLogOnException = false;
await GetResponseAsync("/Auditing/AuditTestPage");
await _auditingStore.Received().SaveAsync(Arg.Is<AuditLogInfo>(x =>
x.Actions.Any(a => a.ServiceName == typeof(AuditTestPage).FullName) &&
x.Actions.Any(a => a.MethodName == nameof(AuditTestPage.OnGet))));
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Success_For_GetRequests()
{
@ -50,7 +62,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
[Fact]
public async Task Should_Trigger_Middleware_And_AuditLog_Exception_When_Returns_Object()
{
@ -62,4 +74,4 @@ namespace Volo.Abp.AspNetCore.Mvc.Auditing
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
}
}
}

16
framework/test/Volo.Abp.Auditing.Tests/Volo/Abp/Auditing/Auditing_Tests.cs

@ -32,7 +32,7 @@ namespace Volo.Abp.Auditing
}
[Fact]
public async Task Should_Write_AuditLog_For_Classes_That_Implement_IAuditingEnabled()
public async Task Should_Write_AuditLog_For_Classes_That_Implement_IAuditingEnabled_With_Containing_Scope()
{
var myAuditedObject1 = GetRequiredService<MyAuditedObject1>();
@ -42,9 +42,17 @@ namespace Volo.Abp.Auditing
await scope.SaveAsync();
}
#pragma warning disable 4014
_auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
#pragma warning restore 4014
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
[Fact]
public async Task Should_Write_AuditLog_For_Classes_That_Implement_IAuditingEnabled_Without_An_Explicit_Scope()
{
var myAuditedObject1 = GetRequiredService<MyAuditedObject1>();
await myAuditedObject1.DoItAsync(new InputObject { Value1 = "forty-two", Value2 = 42 });
await _auditingStore.Received().SaveAsync(Arg.Any<AuditLogInfo>());
}
public interface IMyAuditedObject : ITransientDependency, IAuditingEnabled

5
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo.Abp.GlobalFeatures.Tests.csproj

@ -8,8 +8,11 @@
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.Ddd.Application\Volo.Abp.Ddd.Application.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.GlobalFeatures\Volo.Abp.GlobalFeatures.csproj" />
<ProjectReference Include="..\..\src\Volo.Abp.ExceptionHandling\Volo.Abp.ExceptionHandling.csproj" />
<ProjectReference Include="..\AbpTestBase\AbpTestBase.csproj" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
</ItemGroup>

30
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/AbpGlobalFeatureNotEnableException_Localization_Test.cs

@ -0,0 +1,30 @@
using Shouldly;
using Volo.Abp.AspNetCore.ExceptionHandling;
using Volo.Abp.Localization;
using Xunit;
namespace Volo.Abp.GlobalFeatures
{
public class AbpGlobalFeatureNotEnableException_Localization_Test : GlobalFeatureTestBase
{
private readonly IExceptionToErrorInfoConverter _exceptionToErrorInfoConverter;
public AbpGlobalFeatureNotEnableException_Localization_Test()
{
_exceptionToErrorInfoConverter = GetRequiredService<IExceptionToErrorInfoConverter>();
}
[Fact]
public void AbpAuthorizationException_Localization()
{
using (CultureHelper.Use("zh-Hans"))
{
var exception = new AbpGlobalFeatureNotEnabledException(code: AbpGlobalFeatureErrorCodes.GlobalFeatureIsNotEnabled)
.WithData("ServiceName", "MyService")
.WithData("GlobalFeatureName", "TestFeature");;
var errorInfo = _exceptionToErrorInfoConverter.Convert(exception, false);
errorInfo.Message.ShouldBe("'MyService'服务需要启用'TestFeature'功能.");
}
}
}
}

61
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureInterceptor_Tests.cs

@ -0,0 +1,61 @@
using System.Threading.Tasks;
using Shouldly;
using Volo.Abp.Application.Services;
using Volo.Abp.DependencyInjection;
using Xunit;
namespace Volo.Abp.GlobalFeatures
{
public class GlobalFeatureInterceptor_Tests : GlobalFeatureTestBase
{
private readonly TestAppServiceV1 _testAppServiceV1;
private readonly TestAppServiceV2 _testAppServiceV2;
public GlobalFeatureInterceptor_Tests()
{
_testAppServiceV1 = GetRequiredService<TestAppServiceV1>();
_testAppServiceV2 = GetRequiredService<TestAppServiceV2>();
}
[Fact]
public async Task Interceptor_Test()
{
var ex = await Assert.ThrowsAsync<AbpGlobalFeatureNotEnabledException>(async () =>
{
await _testAppServiceV1.TestMethod();
});
ex.Data["ServiceName"].ShouldBe(_testAppServiceV1.GetType().FullName);
ex.Data["GlobalFeatureName"].ShouldBe(TestFeature.Name);
GlobalFeatureManager.Instance.Enable(TestFeature.Name);
(await _testAppServiceV1.TestMethod()).ShouldBe(1);
(await _testAppServiceV2.TestMethod()).ShouldBe(1);
}
public interface ITestAppService : IApplicationService
{
Task<int> TestMethod();
}
[RequiresGlobalFeature(TestFeature.Name)]
[ExposeServices(typeof(TestAppServiceV1))]
public class TestAppServiceV1 : ApplicationService, ITestAppService
{
public virtual Task<int> TestMethod()
{
return Task.FromResult(1);
}
}
[ExposeServices(typeof(TestAppServiceV2))]
public class TestAppServiceV2 : ApplicationService, ITestAppService
{
public virtual Task<int> TestMethod()
{
return Task.FromResult(1);
}
}
}
}

12
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureManager_Tests.cs

@ -3,21 +3,21 @@ using Xunit;
namespace Volo.Abp.GlobalFeatures
{
public class GlobalFeatureManager_Tests
public class GlobalFeatureManager_Tests : GlobalFeatureTestBase
{
private readonly GlobalFeatureManager _featureManeger;
private readonly GlobalFeatureManager _featureManager;
public GlobalFeatureManager_Tests()
{
_featureManeger = new GlobalFeatureManager();
_featureManager = new GlobalFeatureManager();
}
[Fact]
public void Enable_Feature_By_Name()
{
_featureManeger.IsEnabled("Feature1").ShouldBeFalse();
_featureManeger.Enable("Feature1");
_featureManeger.IsEnabled("Feature1").ShouldBeTrue();
_featureManager.IsEnabled("Feature1").ShouldBeFalse();
_featureManager.Enable("Feature1");
_featureManager.IsEnabled("Feature1").ShouldBeTrue();
}
}
}

12
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureTestBase.cs

@ -0,0 +1,12 @@
using Volo.Abp.Testing;
namespace Volo.Abp.GlobalFeatures
{
public abstract class GlobalFeatureTestBase : AbpIntegratedTest<GlobalFeatureTestModule>
{
protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options)
{
options.UseAutofac();
}
}
}

16
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/GlobalFeatureTestModule.cs

@ -0,0 +1,16 @@
using Volo.Abp.Application;
using Volo.Abp.Autofac;
using Volo.Abp.ExceptionHandling;
using Volo.Abp.Modularity;
namespace Volo.Abp.GlobalFeatures
{
[DependsOn(typeof(AbpAutofacModule))]
[DependsOn(typeof(AbpGlobalFeaturesModule))]
[DependsOn(typeof(AbpDddApplicationModule))]
[DependsOn(typeof(AbpExceptionHandlingModule))]
public class GlobalFeatureTestModule : AbpModule
{
}
}

27
framework/test/Volo.Abp.GlobalFeatures.Tests/Volo/Abp/GlobalFeatures/TestFeature.cs

@ -0,0 +1,27 @@
namespace Volo.Abp.GlobalFeatures
{
[GlobalFeatureName(Name)]
public class TestFeature : Abp.GlobalFeatures.GlobalFeature
{
public const string Name = "TestFeature1";
internal TestFeature(TestGlobalModuleFeatures testGlobalModule)
: base(testGlobalModule)
{
}
}
public class TestGlobalModuleFeatures : GlobalModuleFeatures
{
public const string ModuleName = "GlobalFeatureTest";
public TestFeature Test => GetFeature<TestFeature>();
public TestGlobalModuleFeatures(GlobalFeatureManager featureManager)
: base(featureManager)
{
AddFeature(new TestFeature(this));
}
}
}

2
modules/account/src/Volo.Abp.Account.Web.IdentityServer/Pages/Consent.cshtml

@ -20,8 +20,6 @@
</abp-card-header>
<abp-card-body>
<form method="post" asp-page="/Consent">
<input type="hidden" asp-for="ReturnUrl" />
<input type="hidden" asp-for="ReturnUrlHash" />
<div>Uncheck the permissions you do not wish to grant.</div>

2
modules/account/src/Volo.Abp.Account.Web/Pages/Account/ForgotPassword.cshtml

@ -9,8 +9,6 @@
<h4>@L["ForgotPassword"]</h4>
<form method="post" class="mt-4">
<p>@L["SendPasswordResetLink_Information"]</p>
<input asp-for="ReturnUrl"/>
<input asp-for="ReturnUrlHash"/>
<abp-input asp-for="Email"/>
<abp-button button-type="Primary" size="Block" type="submit" class="mt-2 mb-3">@L["Submit"]</abp-button>
<a asp-page="./Login" asp-all-route-data="@(new Dictionary<string, string> {{"returnUrl", Model.ReturnUrl}, {"returnUrlHash", Model.ReturnUrlHash}})">

4
modules/account/src/Volo.Abp.Account.Web/Pages/Account/Login.cshtml

@ -19,8 +19,6 @@
@if (Model.EnableLocalLogin)
{
<form method="post" class="mt-4">
<input asp-for="ReturnUrl"/>
<input asp-for="ReturnUrlHash"/>
<div class="form-group">
<label asp-for="LoginInput.UserNameOrEmailAddress"></label>
<input asp-for="LoginInput.UserNameOrEmailAddress" class="form-control"/>
@ -52,8 +50,6 @@
<div class="mt-2">
<h5>@L["OrLoginWith"]</h5>
<form asp-page="./Login" asp-page-handler="ExternalLogin" asp-route-returnUrl="@Model.ReturnUrl" asp-route-returnUrlHash="@Model.ReturnUrlHash" method="post">
<input asp-for="ReturnUrl"/>
<input asp-for="ReturnUrlHash"/>
@foreach (var provider in Model.VisibleExternalProviders)
{
<button type="submit" class="btn btn-primary m-1" name="provider" value="@provider.AuthenticationScheme" title="@L["LogInUsingYourProviderAccount", provider.DisplayName]">@provider.DisplayName</button>

2
modules/account/src/Volo.Abp.Account.Web/Pages/Account/ResetPassword.cshtml

@ -9,8 +9,6 @@
<h4>@L["ResetPassword"]</h4>
<form method="post">
<p>@L["ResetPassword_Information"]</p>
<abp-input asp-for="ReturnUrl"/>
<abp-input asp-for="ReturnUrlHash"/>
<abp-input asp-for="UserId"/>
<abp-input asp-for="ResetToken"/>
<abp-input asp-for="Password"/>

2
modules/blogging/app/Volo.BloggingTestApp/BloggingTestAppModule.cs

@ -154,7 +154,7 @@ namespace Volo.BloggingTestApp
app.UseErrorPage();
}
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();

4
modules/blogging/src/Volo.Blogging.Domain.Shared/Volo/Blogging/Localization/Resources/fr.json

@ -39,7 +39,7 @@
"PostDeletionWarningMessage": "Le message sera supprimé.",
"BlogDeletionWarningMessage": "Le blog sera supprimé.",
"AreYouSure": "Êtes-vous sûr?",
"CommentWithCount": "{0 commentaire",
"CommentWithCount": "{0} commentaire",
"Comment": "Commentaire",
"ShareOnTwitter": "Partager sur Twitter",
"CoverImage": "Image de couverture",
@ -55,4 +55,4 @@
"ShareOn": "Partager sur",
"TitleLengthWarning": "Gardez la taille de votre titre sous 60 caractères pour être optimisé pour le référencement!"
}
}
}

2
modules/client-simulation/demo/Volo.ClientSimulation.Demo/ClientSimulationDemoModule.cs

@ -40,7 +40,7 @@ namespace Volo.ClientSimulation.Demo
app.UseDeveloperExceptionPage();
}
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseConfiguredEndpoints();
}

2
modules/cms-kit/host/Volo.CmsKit.HttpApi.Host/CmsKitHttpApiHostModule.cs

@ -164,7 +164,7 @@ namespace Volo.CmsKit
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();

2
modules/cms-kit/host/Volo.CmsKit.IdentityServer/CmsKitIdentityServerModule.cs

@ -186,7 +186,7 @@ namespace Volo.CmsKit
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseCors(DefaultCorsPolicyName);
app.UseAuthentication();

2
modules/cms-kit/host/Volo.CmsKit.Web.Host/CmsKitWebHostModule.cs

@ -222,7 +222,7 @@ namespace Volo.CmsKit
}
app.UseHttpsRedirection();
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();

2
modules/cms-kit/host/Volo.CmsKit.Web.Unified/CmsKitWebUnifiedModule.cs

@ -189,7 +189,7 @@ namespace Volo.CmsKit
}
app.UseHttpsRedirection();
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();

4
modules/cms-kit/src/Volo.CmsKit.EntityFrameworkCore/Volo/CmsKit/EntityFrameworkCore/CmsKitDbContextModelCreatingExtensions.cs

@ -44,6 +44,10 @@ namespace Volo.CmsKit.EntityFrameworkCore
b.HasIndex(x => new { x.TenantId, x.Email });
});
}
else
{
builder.Ignore<CmsUser>();
}
if (GlobalFeatureManager.Instance.IsEnabled<ReactionsFeature>())
{

2
modules/docs/app/VoloDocs.Web/VoloDocsWebModule.cs

@ -150,7 +150,7 @@ namespace VoloDocs.Web
var app = context.GetApplicationBuilder();
var env = context.GetEnvironment();
app.UseVirtualFiles();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();

20
modules/feature-management/Volo.Abp.FeatureManagement.sln

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27703.2026
# Visual Studio Version 16
VisualStudioVersion = 16.0.31105.61
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.FeatureManagement.Domain.Shared", "src\Volo.Abp.FeatureManagement.Domain.Shared\Volo.Abp.FeatureManagement.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}"
EndProject
@ -35,7 +35,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.FeatureManagement.
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.FeatureManagement.Application.Tests", "test\Volo.Abp.FeatureManagement.Application.Tests\Volo.Abp.FeatureManagement.Application.Tests.csproj", "{13A9EAD6-F3A4-4357-BA4A-A7E8FEB4A264}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.FeatureManagement.Blazor", "src\Volo.Abp.FeatureManagement.Blazor\Volo.Abp.FeatureManagement.Blazor.csproj", "{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.FeatureManagement.Blazor", "src\Volo.Abp.FeatureManagement.Blazor\Volo.Abp.FeatureManagement.Blazor.csproj", "{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.FeatureManagement.Blazor.Server", "src\Volo.Abp.FeatureManagement.Blazor.Server\Volo.Abp.FeatureManagement.Blazor.Server.csproj", "{5B2EA81B-9FAE-456E-B83B-58205AA48752}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.FeatureManagement.Blazor.WebAssembly", "src\Volo.Abp.FeatureManagement.Blazor.WebAssembly\Volo.Abp.FeatureManagement.Blazor.WebAssembly.csproj", "{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -103,6 +107,14 @@ Global
{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5}.Release|Any CPU.Build.0 = Release|Any CPU
{5B2EA81B-9FAE-456E-B83B-58205AA48752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B2EA81B-9FAE-456E-B83B-58205AA48752}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B2EA81B-9FAE-456E-B83B-58205AA48752}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B2EA81B-9FAE-456E-B83B-58205AA48752}.Release|Any CPU.Build.0 = Release|Any CPU
{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -123,6 +135,8 @@ Global
{AA783A34-86E4-41A5-AE21-5D9FBD98D858} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{13A9EAD6-F3A4-4357-BA4A-A7E8FEB4A264} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}
{0F34FFD5-E98F-4F77-AE0B-A790BD5810D5} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{5B2EA81B-9FAE-456E-B83B-58205AA48752} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
{A96771F7-65D7-43C2-818E-CF0F5DBC3DC6} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD}

14
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/AbpFeatureManagementBlazorServerModule.cs

@ -0,0 +1,14 @@
using Volo.Abp.AspNetCore.Components.Server.Theming;
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement.Blazor.Server
{
[DependsOn(
typeof(AbpFeatureManagementBlazorModule),
typeof(AbpAspNetCoreComponentsServerThemingModule)
)]
public class AbpFeatureManagementBlazorServerModule : AbpModule
{
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

18
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.Server/Volo.Abp.FeatureManagement.Blazor.Server.csproj

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props"/>
<Import Project="..\..\..\..\common.props"/>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Server.Theming\Volo.Abp.AspNetCore.Components.Server.Theming.csproj"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.FeatureManagement.Blazor\Volo.Abp.FeatureManagement.Blazor.csproj"/>
</ItemGroup>
</Project>

14
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/AbpFeatureManagementBlazorWebAssemblyModule.cs

@ -0,0 +1,14 @@
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming;
using Volo.Abp.Modularity;
namespace Volo.Abp.FeatureManagement.Blazor.WebAssembly
{
[DependsOn(
typeof(AbpFeatureManagementBlazorModule),
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule),
typeof(AbpFeatureManagementHttpApiClientModule)
)]
public class AbpFeatureManagementBlazorWebAssemblyModule : AbpModule
{
}
}

3
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
modules/feature-management/src/Volo.Abp.FeatureManagement.Blazor.WebAssembly/Volo.Abp.FeatureManagement.Blazor.WebAssembly.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
<ProjectReference Include="..\Volo.Abp.FeatureManagement.HttpApi.Client\Volo.Abp.FeatureManagement.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.FeatureManagement.Blazor\Volo.Abp.FeatureManagement.Blazor.csproj" />
</ItemGroup>
</Project>

14
modules/identity/Volo.Abp.Identity.sln

@ -43,6 +43,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.AspNetCor
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Identity.Blazor", "src\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj", "{3F7BB653-3F3A-4889-B73C-E463F239099A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Identity.Blazor.Server", "src\Volo.Abp.Identity.Blazor.Server\Volo.Abp.Identity.Blazor.Server.csproj", "{A5BAC86D-1231-4B95-918E-2011477A81E7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Identity.Blazor.WebAssembly", "src\Volo.Abp.Identity.Blazor.WebAssembly\Volo.Abp.Identity.Blazor.WebAssembly.csproj", "{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -121,6 +125,14 @@ Global
{3F7BB653-3F3A-4889-B73C-E463F239099A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F7BB653-3F3A-4889-B73C-E463F239099A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F7BB653-3F3A-4889-B73C-E463F239099A}.Release|Any CPU.Build.0 = Release|Any CPU
{A5BAC86D-1231-4B95-918E-2011477A81E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A5BAC86D-1231-4B95-918E-2011477A81E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A5BAC86D-1231-4B95-918E-2011477A81E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A5BAC86D-1231-4B95-918E-2011477A81E7}.Release|Any CPU.Build.0 = Release|Any CPU
{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -144,6 +156,8 @@ Global
{736F91E7-8A70-441B-89DE-0E29A348E718} = {AADC5A0A-F100-4511-87DE-B74E55F5B69B}
{89C094EB-D80A-4976-9C10-7CE3EBEEE877} = {9FACAF96-A681-4B36-A938-A37DCA0B7EC1}
{3F7BB653-3F3A-4889-B73C-E463F239099A} = {AADC5A0A-F100-4511-87DE-B74E55F5B69B}
{A5BAC86D-1231-4B95-918E-2011477A81E7} = {AADC5A0A-F100-4511-87DE-B74E55F5B69B}
{4DB89179-EEDC-4C01-9F9E-04A7C106FA7F} = {AADC5A0A-F100-4511-87DE-B74E55F5B69B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {05740D37-83CF-4041-9C2A-D89F1B3DB5A4}

15
modules/identity/src/Volo.Abp.Identity.Blazor.Server/AbpIdentityBlazorServerModule.cs

@ -0,0 +1,15 @@
using Volo.Abp.AspNetCore.Components.Server.Theming;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Blazor.Server;
namespace Volo.Abp.Identity.Blazor.Server
{
[DependsOn(
typeof(AbpIdentityBlazorModule),
typeof(AbpPermissionManagementBlazorServerModule),
typeof(AbpAspNetCoreComponentsServerThemingModule)
)]
public class AbpIdentityBlazorServerModule : AbpModule
{
}
}

3
modules/identity/src/Volo.Abp.Identity.Blazor.Server/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/identity/src/Volo.Abp.Identity.Blazor.Server/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

19
modules/identity/src/Volo.Abp.Identity.Blazor.Server/Volo.Abp.Identity.Blazor.Server.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props"/>
<Import Project="..\..\..\..\common.props"/>
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Server.Theming\Volo.Abp.AspNetCore.Components.Server.Theming.csproj"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj"/>
<ProjectReference Include="..\..\..\permission-management\src\Volo.Abp.PermissionManagement.Blazor.Server\Volo.Abp.PermissionManagement.Blazor.Server.csproj" />
</ItemGroup>
</Project>

16
modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/AbpIdentityBlazorWebAssemblyModule.cs

@ -0,0 +1,16 @@
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.Blazor.WebAssembly;
namespace Volo.Abp.Identity.Blazor.WebAssembly
{
[DependsOn(
typeof(AbpIdentityBlazorModule),
typeof(AbpPermissionManagementBlazorWebAssemblyModule),
typeof(AbpAspNetCoreComponentsWebAssemblyThemingModule),
typeof(AbpIdentityHttpApiClientModule)
)]
public class AbpIdentityBlazorWebAssemblyModule : AbpModule
{
}
}

3
modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

20
modules/identity/src/Volo.Abp.Identity.Blazor.WebAssembly/Volo.Abp.Identity.Blazor.WebAssembly.csproj

@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
<ProjectReference Include="..\Volo.Abp.Identity.HttpApi.Client\Volo.Abp.Identity.HttpApi.Client.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Identity.Blazor\Volo.Abp.Identity.Blazor.csproj" />
<ProjectReference Include="..\..\..\permission-management\src\Volo.Abp.PermissionManagement.Blazor.WebAssembly\Volo.Abp.PermissionManagement.Blazor.WebAssembly.csproj" />
</ItemGroup>
</Project>

9
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeature.cs

@ -1,9 +0,0 @@
namespace Volo.Abp.Identity.Features
{
public class IdentityFeature
{
public const string GroupName = "Identity";
public const string TwoFactor = GroupName + ".TwoFactor";
}
}

51
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityFeatureDefinitionProvider.cs

@ -1,51 +0,0 @@
using System;
using Volo.Abp.Features;
using Volo.Abp.Identity.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Validation.StringValues;
namespace Volo.Abp.Identity.Features
{
public class IdentityFeatureDefinitionProvider : FeatureDefinitionProvider
{
public override void Define(IFeatureDefinitionContext context)
{
var group = context.AddGroup(IdentityFeature.GroupName, L("Feature:IdentityGroup"));
group.AddFeature(IdentityFeature.TwoFactor,
IdentityTwoFactorBehaviour.Optional.ToString(),
L("Feature:TwoFactor"),
L("Feature:TwoFactorDescription"),
new SelectionStringValueType
{
ItemSource = new StaticSelectionStringValueItemSource(
new LocalizableSelectionStringValueItem
{
Value = IdentityTwoFactorBehaviour.Optional.ToString(),
DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Optional")
},
new LocalizableSelectionStringValueItem
{
Value = IdentityTwoFactorBehaviour.Disabled.ToString(),
DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Disabled")
},
new LocalizableSelectionStringValueItem
{
Value = IdentityTwoFactorBehaviour.Forced.ToString(),
DisplayText = GetTwoFactorBehaviourLocalizableStringInfo("Feature:TwoFactor.Forced")
}
)
});
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<IdentityResource>(name);
}
private static LocalizableStringInfo GetTwoFactorBehaviourLocalizableStringInfo(string key)
{
return new LocalizableStringInfo(LocalizationResourceNameAttribute.GetName(typeof(IdentityResource)), key);
}
}
}

11
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviour.cs

@ -1,11 +0,0 @@
namespace Volo.Abp.Identity.Features
{
public enum IdentityTwoFactorBehaviour
{
Optional,
Disabled,
Forced
}
}

23
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Features/IdentityTwoFactorBehaviourFeatureHelper.cs

@ -1,23 +0,0 @@
using System;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Features;
namespace Volo.Abp.Identity.Features
{
public static class IdentityTwoFactorBehaviourFeatureHelper
{
public static async Task<IdentityTwoFactorBehaviour> Get([NotNull] IFeatureChecker featureChecker)
{
Check.NotNull(featureChecker, nameof(featureChecker));
var value = await featureChecker.GetOrNullAsync(IdentityFeature.TwoFactor);
if (value.IsNullOrWhiteSpace() || !Enum.TryParse<IdentityTwoFactorBehaviour>(value, out var behaviour))
{
throw new AbpException($"{IdentityFeature.TwoFactor} feature value is invalid");
}
return behaviour;
}
}
}

12
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/en.json

@ -78,12 +78,6 @@
"Permission:ChangePermissions": "Change permissions",
"Permission:UserManagement": "User management",
"Permission:UserLookup": "User lookup",
"Feature:IdentityGroup": "Identity",
"Feature:TwoFactor": "Two factor behaviour",
"Feature:TwoFactorDescription": "Set two factor behaviour. Optional values: Optional,Disabled,Forced",
"Feature:TwoFactor.Optional": "Optional",
"Feature:TwoFactor.Disabled": "Disabled",
"Feature:TwoFactor.Forced": "Forced",
"DisplayName:Abp.Identity.Password.RequiredLength": "Required length",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Required unique characters number",
"DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Required non-alphanumeric character",
@ -111,10 +105,6 @@
"Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Whether the phoneNumber can be confirmed by the user.",
"Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Whether a confirmed telephone number is required to sign in.",
"Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Whether the username can be updated by the user.",
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "Whether the email can be updated by the user.",
"DisplayName:Abp.Identity.TwoFactorBehaviour": "Two Factor behaviour",
"Description:Abp.Identity.TwoFactorBehaviour": "Two Factor behaviour",
"DisplayName:Abp.Identity.UsersCanChange": "Allow users to change their Two Factor.",
"Description:Abp.Identity.UsersCanChange": "Allow users to change their Two Factor."
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "Whether the email can be updated by the user."
}
}

12
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/tr.json

@ -76,12 +76,6 @@
"Permission:ChangePermissions": "İzinleri değiştirme",
"Permission:UserManagement": "Kullanıcı yönetimi",
"Permission:UserLookup": "Kullanıcı sorgulama",
"Feature:IdentityGroup": "Kimlik",
"Feature:TwoFactor": "İki faktörlü kimlik doğrulama",
"Feature:TwoFactorDescription": "İki faktörlü kimlik doğrulamanın talep edileceği durumu seçin",
"Feature:TwoFactor.Optional": "İsteğe bağlı",
"Feature:TwoFactor.Disabled": "Asla",
"Feature:TwoFactor.Forced": "Her zaman",
"DisplayName:Abp.Identity.Password.RequiredLength": "Uzunluk gerekli",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "Tekil karakter gerekli",
"DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "Alfasayısal olmayan karakter gerekli",
@ -109,10 +103,6 @@
"Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "Oturum açmak için telefon numarası gerekli",
"Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "Oturum açmak için onaylanmış bir telefon numarasının gerekli olup olmadığı.",
"Description:Abp.Identity.User.IsUserNameUpdateEnabled": "Kullanıcı adının, kullanıcının kendisi tarafından güncellenebilirliği.",
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "E-posta alanının, kullanıcının kendisi tarafından güncellenebilirliği",
"DisplayName:Abp.Identity.TwoFactorBehaviour": "İki faktörlü kimlik doğrulama davranışı",
"Description:Abp.Identity.TwoFactorBehaviour": "İki faktörlü kimlik doğrulama davranışı",
"DisplayName:Abp.Identity.UsersCanChange": "Kullanıcıların iki faktörlü kimlik doğrulama davranışını değiştirmelerine izin verin.",
"Description:Abp.Identity.UsersCanChange": "Kullanıcıların iki faktörlü kimlik doğrulama davranışını değiştirmelerine izin verin"
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "E-posta alanının, kullanıcının kendisi tarafından güncellenebilirliği"
}
}

14
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hans.json

@ -78,12 +78,6 @@
"Permission:ChangePermissions": "更改权限",
"Permission:UserManagement": "用户管理",
"Permission:UserLookup": "用户查询",
"Feature:IdentityGroup": "身份标识",
"Feature:TwoFactor": "双因素身份验证行为",
"Feature:TwoFactorDescription": "设置双因素身份验证行为. 可选值:可选,禁用,强制启用",
"Feature:TwoFactor.Optional": "可选",
"Feature:TwoFactor.Disabled": "禁用",
"Feature:TwoFactor.Forced": "强制启用",
"DisplayName:Abp.Identity.Password.RequiredLength": "要求长度",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "要求唯一字符数量",
"DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "要求非字母数字",
@ -111,10 +105,6 @@
"Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "用户是否可以确认电话号码",
"Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "登录时是否需要验证的手机号码.",
"Description:Abp.Identity.User.IsUserNameUpdateEnabled": "是否允许用户更新用户名.",
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "是否允许用户更新电子邮箱.",
"DisplayName:Abp.Identity.TwoFactorBehaviour": "双因素身份验证行为",
"Description:Abp.Identity.TwoFactorBehaviour": "双因素身份验证行为",
"DisplayName:Abp.Identity.UsersCanChange": "允许用户更改其因素身份验证.",
"Description:Abp.Identity.UsersCanChange": "允许用户更改其因素身份验证."
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "是否允许用户更新电子邮箱."
}
}
}

12
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Localization/zh-Hant.json

@ -78,12 +78,6 @@
"Permission:ChangePermissions": "更改權限",
"Permission:UserManagement": "使用者管理",
"Permission:UserLookup": "使用者查詢",
"Feature:IdentityGroup": "身份識別",
"Feature:TwoFactor": "雙因素身份驗證行為",
"Feature:TwoFactorDescription": "設置雙因素身份驗證行為. 可選值:可選,禁用,強制啟用",
"Feature:TwoFactor.Optional": "選用",
"Feature:TwoFactor.Disabled": "關閉",
"Feature:TwoFactor.Forced": "強制啟用",
"DisplayName:Abp.Identity.Password.RequiredLength": "長度需符合",
"DisplayName:Abp.Identity.Password.RequiredUniqueChars": "需最小特殊字元數",
"DisplayName:Abp.Identity.Password.RequireNonAlphanumeric": "需包含非數字字母",
@ -111,10 +105,6 @@
"Description:Abp.Identity.SignIn.EnablePhoneNumberConfirmation": "是否啟用電話認證.",
"Description:Abp.Identity.SignIn.RequireConfirmedPhoneNumber": "決定使用者是否需電話認證後才能登入.",
"Description:Abp.Identity.User.IsUserNameUpdateEnabled": "決定使用者是否能更新帳號.",
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "決定使用者是否能更新信箱.",
"DisplayName:Abp.Identity.TwoFactorBehaviour": "雙因素認證行為",
"Description:Abp.Identity.TwoFactorBehaviour": "雙因素認證行為",
"DisplayName:Abp.Identity.UsersCanChange": "允許使用者變更雙因素認證.",
"Description:Abp.Identity.UsersCanChange": "允許使用者變更雙因素認證."
"Description:Abp.Identity.User.IsEmailUpdateEnabled": "決定使用者是否能更新信箱."
}
}

9
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentitySettingNames.cs

@ -48,14 +48,5 @@
public const string MaxUserMembershipCount = OrganizationUnitPrefix + ".MaxUserMembershipCount";
}
public static class TwoFactor
{
private const string TwoFactorPrefix = Prefix + ".TwoFactor";
public const string Behaviour = TwoFactorPrefix + ".Behaviour";
public const string UsersCanChange = TwoFactorPrefix + ".UsersCanChange";
}
}
}

24
modules/identity/src/Volo.Abp.Identity.Domain.Shared/Volo/Abp/Identity/Settings/IdentityTwoFactorBehaviourSettingHelper.cs

@ -1,24 +0,0 @@
using System;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Identity.Features;
using Volo.Abp.Settings;
namespace Volo.Abp.Identity.Settings
{
public static class IdentityTwoFactorBehaviourSettingHelper
{
public static async Task<IdentityTwoFactorBehaviour> Get([NotNull] ISettingProvider settingProvider)
{
Check.NotNull(settingProvider, nameof(settingProvider));
var value = await settingProvider.GetOrNullAsync(IdentitySettingNames.TwoFactor.Behaviour);
if (value.IsNullOrWhiteSpace() || !Enum.TryParse<IdentityTwoFactorBehaviour>(value, out var behaviour))
{
throw new AbpException($"{IdentitySettingNames.TwoFactor.Behaviour} setting value is invalid");
}
return behaviour;
}
}
}

2
modules/identity/src/Volo.Abp.Identity.Domain/Volo.Abp.Identity.Domain.csproj

@ -22,9 +22,7 @@
<ItemGroup>
<ProjectReference Include="..\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj" />
<ProjectReference Include="..\..\..\users\src\Volo.Abp.Users.Domain\Volo.Abp.Users.Domain.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Ddd.Domain\Volo.Abp.Ddd.Domain.csproj" />
</ItemGroup>

17
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/AbpIdentitySettingDefinitionProvider.cs

@ -1,5 +1,4 @@
using Volo.Abp.Identity.Features;
using Volo.Abp.Identity.Localization;
using Volo.Abp.Identity.Localization;
using Volo.Abp.Identity.Settings;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
@ -112,19 +111,7 @@ namespace Volo.Abp.Identity
int.MaxValue.ToString(),
L("Identity.OrganizationUnit.MaxUserMembershipCount"),
L("Identity.OrganizationUnit.MaxUserMembershipCount"),
true),
new SettingDefinition(IdentitySettingNames.TwoFactor.Behaviour,
IdentityTwoFactorBehaviour.Optional.ToString(),
L("DisplayName:Abp.Identity.TwoFactorBehaviour"),
L("Description:Abp.Identity.TwoFactorBehaviour"),
isVisibleToClients: true),
new SettingDefinition(IdentitySettingNames.TwoFactor.UsersCanChange,
true.ToString(),
L("DisplayName:Abp.Identity.UsersCanChange"),
L("Description:Abp.Identity.UsersCanChange"),
isVisibleToClients: true)
true)
);
}

70
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityTwoFactorManager.cs

@ -1,70 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.Domain.Services;
using Volo.Abp.Features;
using Volo.Abp.Identity.Features;
using Volo.Abp.Identity.Settings;
using Volo.Abp.Settings;
namespace Volo.Abp.Identity
{
public class IdentityTwoFactorManager : IDomainService
{
protected IFeatureChecker FeatureChecker { get; }
protected ISettingProvider SettingProvider { get; }
public IdentityTwoFactorManager(IFeatureChecker featureChecker, ISettingProvider settingProvider)
{
FeatureChecker = featureChecker;
SettingProvider = settingProvider;
}
public virtual async Task<bool> IsOptionalAsync()
{
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker);
if (feature == IdentityTwoFactorBehaviour.Optional)
{
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider);
if (setting == IdentityTwoFactorBehaviour.Optional)
{
return true;
}
}
return false;
}
public virtual async Task<bool> IsForcedEnableAsync()
{
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker);
if (feature == IdentityTwoFactorBehaviour.Forced)
{
return true;
}
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider);
if (setting == IdentityTwoFactorBehaviour.Forced)
{
return true;
}
return false;
}
public virtual async Task<bool> IsForcedDisableAsync()
{
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker);
if (feature == IdentityTwoFactorBehaviour.Disabled)
{
return true;
}
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider);
if (setting == IdentityTwoFactorBehaviour.Disabled)
{
return true;
}
return false;
}
}
}

35
modules/identity/src/Volo.Abp.Identity.Domain/Volo/Abp/Identity/IdentityUserStore.cs

@ -11,11 +11,7 @@ using Microsoft.Extensions.Logging;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Features;
using Volo.Abp.Guids;
using Volo.Abp.Identity.Features;
using Volo.Abp.Identity.Settings;
using Volo.Abp.Settings;
namespace Volo.Abp.Identity
{
@ -60,17 +56,12 @@ namespace Volo.Abp.Identity
protected ILookupNormalizer LookupNormalizer { get; }
protected IIdentityUserRepository UserRepository { get; }
protected IFeatureChecker FeatureChecker { get; }
protected ISettingProvider SettingProvider { get; }
public IdentityUserStore(
IIdentityUserRepository userRepository,
IIdentityRoleRepository roleRepository,
IGuidGenerator guidGenerator,
ILogger<IdentityRoleStore> logger,
ILookupNormalizer lookupNormalizer,
IFeatureChecker featureChecker,
ISettingProvider settingProvider,
IdentityErrorDescriber describer = null)
{
UserRepository = userRepository;
@ -78,8 +69,6 @@ namespace Volo.Abp.Identity
GuidGenerator = guidGenerator;
Logger = logger;
LookupNormalizer = lookupNormalizer;
FeatureChecker = featureChecker;
SettingProvider = settingProvider;
ErrorDescriber = describer ?? new IdentityErrorDescriber();
}
@ -942,33 +931,13 @@ namespace Volo.Abp.Identity
/// The <see cref="Task"/> that represents the asynchronous operation, containing a flag indicating whether the specified
/// <paramref name="user"/> has two factor authentication enabled or not.
/// </returns>
public virtual async Task<bool> GetTwoFactorEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default)
public virtual Task<bool> GetTwoFactorEnabledAsync([NotNull] IdentityUser user, CancellationToken cancellationToken = default)
{
cancellationToken.ThrowIfCancellationRequested();
Check.NotNull(user, nameof(user));
var feature = await IdentityTwoFactorBehaviourFeatureHelper.Get(FeatureChecker);
if (feature == IdentityTwoFactorBehaviour.Disabled)
{
return false;
}
if (feature == IdentityTwoFactorBehaviour.Forced)
{
return true;
}
var setting = await IdentityTwoFactorBehaviourSettingHelper.Get(SettingProvider);
if (setting == IdentityTwoFactorBehaviour.Disabled)
{
return false;
}
if (setting == IdentityTwoFactorBehaviour.Forced)
{
return true;
}
return user.TwoFactorEnabled;
return Task.FromResult(user.TwoFactorEnabled);
}
/// <summary>

4
modules/identity/src/Volo.Abp.Identity.MongoDB/Volo/Abp/Identity/MongoDB/AbpIdentityMongoDbModule.cs

@ -16,8 +16,8 @@ namespace Volo.Abp.Identity.MongoDB
{
options.AddRepository<IdentityUser, MongoIdentityUserRepository>();
options.AddRepository<IdentityRole, MongoIdentityRoleRepository>();
options.AddRepository<IdentityClaimType, MongoIdentityRoleRepository>();
options.AddRepository<OrganizationUnit, MongoIdentityRoleRepository>();
options.AddRepository<IdentityClaimType, MongoIdentityClaimTypeRepository>();
options.AddRepository<OrganizationUnit, MongoOrganizationUnitRepository>();
options.AddRepository<IdentitySecurityLog, MongoIdentitySecurityLogRepository>();
options.AddRepository<IdentityLinkUser, MongoIdentityLinkUserRepository>();
});

14
modules/permission-management/Volo.Abp.PermissionManagement.sln

@ -37,6 +37,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.PermissionManageme
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.PermissionManagement.Blazor", "src\Volo.Abp.PermissionManagement.Blazor\Volo.Abp.PermissionManagement.Blazor.csproj", "{6F899C50-83BB-43C4-983A-DCCD8FBBF066}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.PermissionManagement.Blazor.Server", "src\Volo.Abp.PermissionManagement.Blazor.Server\Volo.Abp.PermissionManagement.Blazor.Server.csproj", "{88B39D54-5289-4D39-B4B9-E7C264ED2996}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.PermissionManagement.Blazor.WebAssembly", "src\Volo.Abp.PermissionManagement.Blazor.WebAssembly\Volo.Abp.PermissionManagement.Blazor.WebAssembly.csproj", "{C8AA18AA-BD1F-4E58-92C6-12F846C02000}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -103,6 +107,14 @@ Global
{6F899C50-83BB-43C4-983A-DCCD8FBBF066}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F899C50-83BB-43C4-983A-DCCD8FBBF066}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F899C50-83BB-43C4-983A-DCCD8FBBF066}.Release|Any CPU.Build.0 = Release|Any CPU
{88B39D54-5289-4D39-B4B9-E7C264ED2996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88B39D54-5289-4D39-B4B9-E7C264ED2996}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88B39D54-5289-4D39-B4B9-E7C264ED2996}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88B39D54-5289-4D39-B4B9-E7C264ED2996}.Release|Any CPU.Build.0 = Release|Any CPU
{C8AA18AA-BD1F-4E58-92C6-12F846C02000}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8AA18AA-BD1F-4E58-92C6-12F846C02000}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8AA18AA-BD1F-4E58-92C6-12F846C02000}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8AA18AA-BD1F-4E58-92C6-12F846C02000}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -123,6 +135,8 @@ Global
{1CD80519-9431-48DB-B0EA-291A73FF9F49} = {B559B878-38F7-49CC-BC06-43A32D68C1A7}
{A0F72F5F-3713-4E06-ADB7-15ADFDCB79B1} = {63DA4A89-5908-4F37-B7E6-525AEEF20C77}
{6F899C50-83BB-43C4-983A-DCCD8FBBF066} = {B559B878-38F7-49CC-BC06-43A32D68C1A7}
{88B39D54-5289-4D39-B4B9-E7C264ED2996} = {B559B878-38F7-49CC-BC06-43A32D68C1A7}
{C8AA18AA-BD1F-4E58-92C6-12F846C02000} = {B559B878-38F7-49CC-BC06-43A32D68C1A7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8FC7DF78-5E2D-489F-9D43-147D2ABAA112}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save