2021-08-27 15:03:47 +00:00
|
|
|
using System;
|
2020-06-15 23:15:59 +00:00
|
|
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
|
|
|
using PluralKit.Core;
|
|
|
|
|
|
|
|
namespace PluralKit.API
|
|
|
|
{
|
|
|
|
public class PrivacyRequirement<T>: IAuthorizationRequirement
|
|
|
|
{
|
|
|
|
public readonly Func<T, PrivacyLevel> Mapper;
|
2021-08-27 15:03:47 +00:00
|
|
|
|
2020-06-15 23:15:59 +00:00
|
|
|
public PrivacyRequirement(Func<T, PrivacyLevel> mapper)
|
|
|
|
{
|
|
|
|
Mapper = mapper;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|