2020-02-12 14:16:19 +00:00
|
|
|
|
namespace PluralKit.Core
|
|
|
|
|
{
|
|
|
|
|
public enum PrivacyLevel
|
|
|
|
|
{
|
|
|
|
|
Public = 1,
|
|
|
|
|
Private = 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static class PrivacyExt
|
|
|
|
|
{
|
|
|
|
|
public static bool CanAccess(this PrivacyLevel level, LookupContext ctx) =>
|
|
|
|
|
level == PrivacyLevel.Public || ctx == LookupContext.ByOwner;
|
2020-06-17 21:06:49 +00:00
|
|
|
|
|
|
|
|
|
public static string Name(this PrivacyLevel level) =>
|
|
|
|
|
level == PrivacyLevel.Public ? "public" : "private";
|
2020-02-12 14:16:19 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public enum LookupContext
|
|
|
|
|
{
|
|
|
|
|
ByOwner,
|
|
|
|
|
ByNonOwner,
|
|
|
|
|
API
|
|
|
|
|
}
|
|
|
|
|
}
|