first commit

This commit is contained in:
2025-02-26 23:42:19 +01:00
commit 777ea98be1
283 changed files with 88266 additions and 0 deletions
@@ -0,0 +1,42 @@
using System.Diagnostics;
namespace OpenWarehouse.auth.api.Common.CustomIdentifyManager;
public static class AccountClaimsClass
{
private static readonly Dictionary<AccountClaims, string> AccountTypeDict = new()
{
{ AccountClaims.ServiceAdress, "Service_Adress" },
{ AccountClaims.ServiceName, "ServiceName" },
{ AccountClaims.IfUserCanChangeRole, "PrivilageFunct" }
};
public static Claim GetClaim(this AccountClaims claims, string val)
{
var isSuccess = AccountTypeDict.TryGetValue(claims,out var res);
if (isSuccess && res != null)
{
return new Claim(res, val);
}
else
{
throw new NotImplementedException("Claim not implemented!");
}
}
public static string GetName(AccountClaims claims)
{
var isSuccess = AccountTypeDict.TryGetValue(claims,out var res);
if (isSuccess && res != null)
{
return res;
}
else
{
throw new NotImplementedException("Claim not implemented!");
}
}
}