mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
feat: clean up command parsing for pk;system
This commit is contained in:
parent
d11e84246d
commit
aacf5909a9
5 changed files with 182 additions and 160 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue