You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
865 B
C#
29 lines
865 B
C#
using NPin.Framework.SettingManagement.Domain.Store;
|
|
using Volo.Abp.DependencyInjection;
|
|
using Volo.Abp.Settings;
|
|
using Volo.Abp.Users;
|
|
|
|
namespace NPin.Framework.SettingManagement.Domain.Provider;
|
|
|
|
public class UserSettingManagementProvider : SettingManagementProvider, ITransientDependency
|
|
{
|
|
public override string Name => UserSettingValueProvider.ProviderName;
|
|
|
|
protected ICurrentUser CurrentUser { get; }
|
|
|
|
public UserSettingManagementProvider(ISettingManagementStore settingManagementStore, ICurrentUser currentUser) :
|
|
base(settingManagementStore)
|
|
{
|
|
CurrentUser = currentUser;
|
|
}
|
|
|
|
protected override string? NormalizeProviderKey(string? providerKey)
|
|
{
|
|
if (providerKey != null)
|
|
{
|
|
return providerKey;
|
|
}
|
|
|
|
return CurrentUser?.Id.ToString();
|
|
}
|
|
} |