consolidated settings into confighelper, fixed shop supplies access issue for non root user.

This commit is contained in:
DESKTOP-T0O5CDB\DESK-555BD
2024-02-08 16:54:01 -07:00
parent fd8f93ee5f
commit 08ace8b08d
5 changed files with 21 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ namespace CarCareTracker.Helper
bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData);
string GetLogoUrl();
string GetServerLanguage();
bool GetServerEnableShopSupplies();
public bool DeleteUserConfig(int userId);
}
public class ConfigHelper : IConfigHelper
@@ -40,6 +41,10 @@ namespace CarCareTracker.Helper
var serverLanguage = _config[nameof(UserConfig.UserLanguage)] ?? "en_US";
return serverLanguage;
}
public bool GetServerEnableShopSupplies()
{
return bool.Parse(_config[nameof(UserConfig.EnableShopSupplies)] ?? "false");
}
public bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData)
{
var storedUserId = user.FindFirstValue(ClaimTypes.NameIdentifier);