mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1013 B
34 lines
1013 B
// ==========================================================================
|
|
// MongoUserClaim.cs
|
|
// Squidex Headless CMS
|
|
// ==========================================================================
|
|
// Copyright (c) Squidex Group
|
|
// All rights reserved.
|
|
// ==========================================================================
|
|
|
|
using System.Security.Claims;
|
|
using MongoDB.Bson.Serialization.Attributes;
|
|
|
|
namespace Squidex.Domain.Users.MongoDb
|
|
{
|
|
public sealed class MongoUserClaim
|
|
{
|
|
[BsonRequired]
|
|
[BsonElement]
|
|
public string Type { get; set; }
|
|
|
|
[BsonRequired]
|
|
[BsonElement]
|
|
public string Value { get; set; }
|
|
|
|
public static implicit operator MongoUserClaim(Claim claim)
|
|
{
|
|
return new MongoUserClaim { Type = claim.Type, Value = claim.Value };
|
|
}
|
|
|
|
public static implicit operator Claim(MongoUserClaim userClaim)
|
|
{
|
|
return new Claim(userClaim.Type, userClaim.Value);
|
|
}
|
|
}
|
|
}
|
|
|