maliming
3 years ago
No known key found for this signature in database
GPG Key ID: A646B9CB645ECEA4
13 changed files with
43 additions and
3 deletions
-
modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/AllowChangingTimeZoneSettingsFeatureSimpleStateChecker.cs
-
modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissionDefinitionProvider.cs
-
modules/setting-management/src/Volo.Abp.SettingManagement.Application.Contracts/Volo/Abp/SettingManagement/SettingManagementPermissions.cs
-
modules/setting-management/src/Volo.Abp.SettingManagement.Application/Volo/Abp/SettingManagement/TimeZoneSettingsAppService.cs
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/el.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/en.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/fi.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hr.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/hu.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/pt-BR.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/tr.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hans.json
-
modules/setting-management/src/Volo.Abp.SettingManagement.Domain.Shared/Volo/Abp/SettingManagement/Localization/Resources/AbpSettingManagement/zh-Hant.json
|
|
|
@ -0,0 +1,24 @@ |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.Authorization.Permissions; |
|
|
|
using Volo.Abp.Features; |
|
|
|
using Volo.Abp.MultiTenancy; |
|
|
|
using Volo.Abp.SimpleStateChecking; |
|
|
|
|
|
|
|
namespace Volo.Abp.SettingManagement; |
|
|
|
|
|
|
|
public class AllowChangingTimeZoneSettingsFeatureSimpleStateChecker : ISimpleStateChecker<PermissionDefinition> |
|
|
|
{ |
|
|
|
public async Task<bool> IsEnabledAsync(SimpleStateCheckerContext<PermissionDefinition> context) |
|
|
|
{ |
|
|
|
var currentTenant = context.ServiceProvider.GetRequiredService<ICurrentTenant>(); |
|
|
|
|
|
|
|
if (!currentTenant.IsAvailable) |
|
|
|
{ |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
var featureChecker = context.ServiceProvider.GetRequiredService<IFeatureChecker>(); |
|
|
|
return await featureChecker.IsEnabledAsync(SettingManagementFeatures.EnableTimeZone); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -15,6 +15,9 @@ public class SettingManagementPermissionDefinitionProvider : PermissionDefinitio |
|
|
|
emailPermission.StateCheckers.Add(new AllowChangingEmailSettingsFeatureSimpleStateChecker()); |
|
|
|
|
|
|
|
emailPermission.AddChild(SettingManagementPermissions.EmailingTest, L("Permission:EmailingTest")); |
|
|
|
|
|
|
|
moduleGroup.AddPermission(SettingManagementPermissions.TimeZone, L("Permission:TimeZone")); |
|
|
|
emailPermission.StateCheckers.Add(new AllowChangingTimeZoneSettingsFeatureSimpleStateChecker()); |
|
|
|
} |
|
|
|
|
|
|
|
private static LocalizableString L(string name) |
|
|
|
|
|
|
|
@ -7,9 +7,11 @@ public class SettingManagementPermissions |
|
|
|
public const string GroupName = "SettingManagement"; |
|
|
|
|
|
|
|
public const string Emailing = GroupName + ".Emailing"; |
|
|
|
|
|
|
|
|
|
|
|
public const string EmailingTest = Emailing + ".Test"; |
|
|
|
|
|
|
|
public const string TimeZone = GroupName + ".TimeZone"; |
|
|
|
|
|
|
|
public static string[] GetAll() |
|
|
|
{ |
|
|
|
return ReflectionHelper.GetPublicConstantsRecursively(typeof(SettingManagementPermissions)); |
|
|
|
|
|
|
|
@ -2,6 +2,7 @@ using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Authorization; |
|
|
|
using TimeZoneConverter; |
|
|
|
using Volo.Abp.Features; |
|
|
|
using Volo.Abp.MultiTenancy; |
|
|
|
@ -11,6 +12,7 @@ using Volo.Abp.Timing; |
|
|
|
namespace Volo.Abp.SettingManagement; |
|
|
|
|
|
|
|
[RequiresFeature(SettingManagementFeatures.EnableTimeZone)] |
|
|
|
[Authorize(SettingManagementPermissions.TimeZone)] |
|
|
|
public class TimeZoneSettingsAppService : SettingManagementAppServiceBase, ITimeZoneSettingsAppService |
|
|
|
{ |
|
|
|
protected ISettingManager SettingManager { get; } |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Διαχείριση ρυθμίσεων", |
|
|
|
"Permission:Emailing": "Αποστολή email", |
|
|
|
"Permission:EmailingTest": "Αποστολή δοκιμαστικού email", |
|
|
|
"Permission:TimeZone": "Ζώνη ώρας", |
|
|
|
"SendTestEmail": "Αποστολή δοκιμαστικού email", |
|
|
|
"SenderEmailAddress": "Διεύθυνση email αποστολέα", |
|
|
|
"TargetEmailAddress": "Διεύθυνση email παραλήπτη", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Setting Management", |
|
|
|
"Permission:Emailing": "Emailing", |
|
|
|
"Permission:EmailingTest": "Emailing test", |
|
|
|
"Permission:TimeZone": "Time zone", |
|
|
|
"SendTestEmail": "Send test email", |
|
|
|
"SenderEmailAddress": "Sender email address", |
|
|
|
"TargetEmailAddress": "Target email address", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Asetusten hallinta", |
|
|
|
"Permission:Emailing": "Sähköpostiviestit", |
|
|
|
"Permission:EmailingTest": "Sähköpostitesti", |
|
|
|
"Permission:TimeZone": "Aikavyöhyke", |
|
|
|
"SendTestEmail": "Lähetä testisähköposti", |
|
|
|
"SenderEmailAddress": "Lähettäjän sähköpostiosoite", |
|
|
|
"TargetEmailAddress": "Kohdesähköpostiosoite", |
|
|
|
@ -31,4 +32,4 @@ |
|
|
|
"Feature:AllowChangingEmailSettings": "Salli sähköpostiasetusten muuttaminen.", |
|
|
|
"Feature:AllowChangingEmailSettingsDescription": "Salli sähköpostiasetusten muuttaminen." |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -7,6 +7,7 @@ |
|
|
|
"Permission:Emailing": "Slanje e-poštom", |
|
|
|
"Permission:EmailingTest": "Test slanja e-pošte", |
|
|
|
"SendTestEmail": "Po�alji probnu e-poštu", |
|
|
|
"Permission:TimeZone": "Vremenska zona", |
|
|
|
"SenderEmailAddress": "Adresa e-pošte pošiljatelja", |
|
|
|
"TargetEmailAddress": "Ciljana adresa e-pošte", |
|
|
|
"Subject": "Predmet", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Beállításkezelés", |
|
|
|
"Permission:Emailing": "E-mailezés", |
|
|
|
"Permission:EmailingTest": "E-mail teszt", |
|
|
|
"Permission:TimeZone": "Időzóna", |
|
|
|
"SendTestEmail": "Küldj teszt e-mailt", |
|
|
|
"SenderEmailAddress": "Feladó e-mail címe", |
|
|
|
"TargetEmailAddress": "Cél e-mail cím", |
|
|
|
@ -31,4 +32,4 @@ |
|
|
|
"Feature:AllowChangingEmailSettings": "Az e-mail beállítások módosításának engedélyezése.", |
|
|
|
"Feature:AllowChangingEmailSettingsDescription": "Az e-mail beállítások módosításának engedélyezése." |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Gestão de Cenários", |
|
|
|
"Permission:Emailing": "Enviando por e-mail", |
|
|
|
"Permission:EmailingTest": "Teste de e-mail", |
|
|
|
"Permission:TimeZone": "Fuso horário", |
|
|
|
"SendTestEmail": "Enviar e-mail de teste", |
|
|
|
"SenderEmailAddress": "E-mail remetente", |
|
|
|
"TargetEmailAddress": "E-mail destinatário", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "Ayarlar yönetimi", |
|
|
|
"Permission:Emailing": "Email", |
|
|
|
"Permission:EmailingTest": "Email testi", |
|
|
|
"Permission:TimeZone": "Zaman dilimi", |
|
|
|
"SendTestEmail": "Test emaili gönder", |
|
|
|
"SenderEmailAddress": "Gönderen email adresi", |
|
|
|
"TargetEmailAddress": "Hedef email adresi", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "设置管理", |
|
|
|
"Permission:Emailing": "邮件", |
|
|
|
"Permission:EmailingTest": "邮件测试", |
|
|
|
"Permission:TimeZone": "时区", |
|
|
|
"SendTestEmail": "发送测试邮件", |
|
|
|
"SenderEmailAddress": "发件人邮箱地址", |
|
|
|
"TargetEmailAddress": "收件人邮箱地址", |
|
|
|
|
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
"Permission:SettingManagement": "設定管理", |
|
|
|
"Permission:Emailing": "信箱", |
|
|
|
"Permission:EmailingTest": "郵件測試", |
|
|
|
"Permission:TimeZone": "時區", |
|
|
|
"SendTestEmail": "發送測試郵件", |
|
|
|
"SenderEmailAddress": "發送者電子郵件地址", |
|
|
|
"TargetEmailAddress": "目標電子郵件地址", |
|
|
|
|