feat: clean up command parsing for pk;system

This commit is contained in:
spiral
2021-12-05 17:21:31 -05:00
parent d11e84246d
commit aacf5909a9
5 changed files with 182 additions and 160 deletions

View File

@@ -27,6 +27,13 @@ public static class ContextChecksExt
throw new PKError("You do not have permission to access this information.");
}
public static Context CheckOwnSystem(this Context ctx, PKSystem system)
{
if (system.Id != ctx.System?.Id)
throw Errors.NotOwnSystemError;
return ctx;
}
public static Context CheckOwnMember(this Context ctx, PKMember member)
{
if (member.System != ctx.System?.Id)