fix(apiv2): don't erroneously expose helper methods as endpoints

asp.net why
This commit is contained in:
spiral 2021-10-15 04:29:04 -04:00
parent 8e1409bd17
commit 611fc65a99
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -74,21 +74,21 @@ namespace PluralKit.API
return Task.FromResult<PKGroup?>(null); return Task.FromResult<PKGroup?>(null);
} }
public LookupContext ContextFor(PKSystem system) protected LookupContext ContextFor(PKSystem system)
{ {
HttpContext.Items.TryGetValue("SystemId", out var systemId); HttpContext.Items.TryGetValue("SystemId", out var systemId);
if (systemId == null) return LookupContext.ByNonOwner; if (systemId == null) return LookupContext.ByNonOwner;
return ((SystemId)systemId) == system.Id ? LookupContext.ByOwner : LookupContext.ByNonOwner; return ((SystemId)systemId) == system.Id ? LookupContext.ByOwner : LookupContext.ByNonOwner;
} }
public LookupContext ContextFor(PKMember member) protected LookupContext ContextFor(PKMember member)
{ {
HttpContext.Items.TryGetValue("SystemId", out var systemId); HttpContext.Items.TryGetValue("SystemId", out var systemId);
if (systemId == null) return LookupContext.ByNonOwner; if (systemId == null) return LookupContext.ByNonOwner;
return ((SystemId)systemId) == member.System ? LookupContext.ByOwner : LookupContext.ByNonOwner; return ((SystemId)systemId) == member.System ? LookupContext.ByOwner : LookupContext.ByNonOwner;
} }
public LookupContext ContextFor(PKGroup group) protected LookupContext ContextFor(PKGroup group)
{ {
HttpContext.Items.TryGetValue("SystemId", out var systemId); HttpContext.Items.TryGetValue("SystemId", out var systemId);
if (systemId == null) return LookupContext.ByNonOwner; if (systemId == null) return LookupContext.ByNonOwner;