* add jwt expiry * bump api version * start rework permissions * ok so in theory this compiles * update api * update api * update api * update api once more * oh apiii I hate submodules * blabla * we only live to suffer * stop reading my commit messages * nothing to see here move along * update nuget * some rework --------- Co-authored-by: rootdarkarchon <root.darkarchon@outlook.com>
28 lines
820 B
C#
28 lines
820 B
C#
using MareSynchronos.API.Data.Enum;
|
|
|
|
namespace MareSynchronos.API.Data.Extensions;
|
|
|
|
public static class GroupUserInfoExtensions
|
|
{
|
|
public static bool IsModerator(this GroupPairUserInfo info)
|
|
{
|
|
return info.HasFlag(GroupPairUserInfo.IsModerator);
|
|
}
|
|
|
|
public static bool IsPinned(this GroupPairUserInfo info)
|
|
{
|
|
return info.HasFlag(GroupPairUserInfo.IsPinned);
|
|
}
|
|
|
|
public static void SetModerator(this ref GroupPairUserInfo info, bool isModerator)
|
|
{
|
|
if (isModerator) info |= GroupPairUserInfo.IsModerator;
|
|
else info &= ~GroupPairUserInfo.IsModerator;
|
|
}
|
|
|
|
public static void SetPinned(this ref GroupPairUserInfo info, bool isPinned)
|
|
{
|
|
if (isPinned) info |= GroupPairUserInfo.IsPinned;
|
|
else info &= ~GroupPairUserInfo.IsPinned;
|
|
}
|
|
} |