Browse Source

Merge pull request #184 from colinin/4.0

some commits
pull/252/head
cKey 5 years ago
committed by GitHub
parent
commit
7e94f7a517
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml
  2. 30
      aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs
  3. 14
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs

13
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml

@ -9,11 +9,6 @@
消费者查找器
</summary>
</member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpCAPEventBusOptions">
<summary>
Abp Cap事件配置
</summary>
</member>
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpDistributedEventBusOptions">
<summary>
Abp分布式事件配置
@ -24,7 +19,7 @@
服务提供者
</summary>
</member>
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions},Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})">
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})">
<summary>
Creates a new <see cref="T:DotNetCore.CAP.Internal.ConsumerServiceSelector" />.
</summary>
@ -137,12 +132,6 @@
default: false
</summary>
</member>
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions.NameInEventDataType">
<summary>
事件名称定义在事件参数类型
default: true
</summary>
</member>
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusOptions.CleanUpExpiresMessageBatch">
<summary>
批量清理数量

30
aspnet-core/modules/permissions-management/LINGYUN.Abp.PermissionManagement.Domain/LINGYUN/Abp/PermissionManagement/FixClientPermissionValueProvider.cs

@ -1,30 +0,0 @@
using System.Threading.Tasks;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.PermissionManagement
{
// fix: https://github.com/abpframework/abp/issues/6022
// TODO: 在4.0正式版中已修复此问题,升级后需要移除
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ClientPermissionValueProvider))]
public class FixClientPermissionValueProvider : ClientPermissionValueProvider
{
protected ICurrentTenant CurrentTenant { get; }
public FixClientPermissionValueProvider(
IPermissionStore permissionStore,
ICurrentTenant currentTenant) : base(permissionStore, currentTenant)
{
CurrentTenant = currentTenant;
}
public override async Task<PermissionGrantResult> CheckAsync(PermissionValueCheckContext context)
{
using (CurrentTenant.Change(null))
{
return await base.CheckAsync(context);
}
}
}
}

14
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/TenantCreateEventHandler.cs

@ -21,11 +21,13 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
protected ISettingProvider SettingProvider { get; }
protected IStringLocalizer StringLocalizer { get; }
protected INotificationSender NotificationSender { get; }
protected INotificationSubscriptionManager NotificationSubscriptionManager { get; }
public TenantCreateEventHandler(
ICurrentTenant currentTenant,
ISettingProvider settingProvider,
INotificationSender notificationSender,
INotificationSubscriptionManager notificationSubscriptionManager,
IStringLocalizer<MessageServiceResource> stringLocalizer,
ILogger<TenantCreateEventHandler> logger)
{
@ -34,10 +36,20 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
SettingProvider = settingProvider;
StringLocalizer = stringLocalizer;
NotificationSender = notificationSender;
NotificationSubscriptionManager = notificationSubscriptionManager;
}
public async Task HandleEventAsync(CreateEventData eventData)
{
var tenantAdminUserIdentifier = new UserIdentifier(eventData.AdminUserId, eventData.AdminEmailAddress);
// 租户管理员订阅事件
await NotificationSubscriptionManager
.SubscribeAsync(
eventData.Id,
tenantAdminUserIdentifier,
TenantNotificationNames.NewTenantRegistered);
var userDefaultCultureName = await SettingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
if (userDefaultCultureName.IsNullOrWhiteSpace())
{
@ -46,8 +58,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
// 使用系统区域语言发布通知
using (CultureHelper.Use(userDefaultCultureName, userDefaultCultureName))
{
var tenantAdminUserIdentifier = new UserIdentifier(eventData.AdminUserId, eventData.AdminEmailAddress);
var notificationData = new NotificationData();
notificationData.WriteStandardData(
L("NewTenantRegisteredNotificationTitle"),

Loading…
Cancel
Save