Browse Source

Better check for TimeZonePageContributor

pull/21497/head
enisn 1 year ago
parent
commit
9dfdfab54b
No known key found for this signature in database GPG Key ID: A052619F04155D1C
  1. 5
      modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/TimeZonePageContributor.cs

5
modules/setting-management/src/Volo.Abp.SettingManagement.Blazor/Settings/TimeZonePageContributor.cs

@ -14,7 +14,7 @@ public class TimeZonePageContributor : ISettingComponentContributor
public async Task ConfigureAsync(SettingComponentCreationContext context)
{
var l = context.ServiceProvider.GetRequiredService<IStringLocalizer<AbpSettingManagementResource>>();
if (context.ServiceProvider.GetRequiredService<IClock>().SupportsMultipleTimezone)
if (await CheckPermissionsAsync(context))
{
context.Groups.Add(
new SettingComponentGroup(
@ -30,6 +30,7 @@ public class TimeZonePageContributor : ISettingComponentContributor
{
var authorizationService = context.ServiceProvider.GetRequiredService<IAuthorizationService>();
return await authorizationService.IsGrantedAsync(SettingManagementPermissions.TimeZone);
return context.ServiceProvider.GetRequiredService<IClock>().SupportsMultipleTimezone
&& await authorizationService.IsGrantedAsync(SettingManagementPermissions.TimeZone);
}
}

Loading…
Cancel
Save