19 lines
No EOL
411 B
C#
19 lines
No EOL
411 B
C#
using System.Security.Claims;
|
|
using StalwartSimpleLoginMiddleware.Entities;
|
|
|
|
namespace StalwartSimpleLoginMiddleware.Utilities;
|
|
|
|
public static class ClaimsHelper
|
|
{
|
|
public static List<Claim> BuildClaims(ApiKey apiKey)
|
|
{
|
|
var claims = new List<Claim>();
|
|
|
|
if (apiKey.IsAdmin)
|
|
{
|
|
claims.Add(new Claim(ClaimTypes.Role, "Admin"));
|
|
}
|
|
|
|
return claims;
|
|
}
|
|
} |