2020-06-16 01:15:59 +02:00
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
|
|
using PluralKit.Core;
|
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
namespace PluralKit.API;
|
|
|
|
|
|
|
|
public class PrivacyRequirement<T>: IAuthorizationRequirement
|
2020-06-16 01:15:59 +02:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
public readonly Func<T, PrivacyLevel> Mapper;
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public PrivacyRequirement(Func<T, PrivacyLevel> mapper)
|
|
|
|
{
|
|
|
|
Mapper = mapper;
|
2020-06-16 01:15:59 +02:00
|
|
|
}
|
|
|
|
}
|