mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
fix(apiv2): correctly apply privacy settings on switch get
This commit is contained in:
parent
e2a56a198f
commit
c164fad2ac
2 changed files with 5 additions and 5 deletions
|
|
@ -105,13 +105,13 @@ namespace PluralKit.API
|
|||
if (system == null)
|
||||
throw APIErrors.SystemNotFound;
|
||||
|
||||
var sw = await _repo.GetSwitchByUuid(switchId);
|
||||
if (sw == null || system.Id != sw.System)
|
||||
throw APIErrors.SwitchNotFound;
|
||||
|
||||
var ctx = this.ContextFor(system);
|
||||
|
||||
if (!system.FrontHistoryPrivacy.CanAccess(ctx))
|
||||
throw APIErrors.UnauthorizedFrontHistory;
|
||||
|
||||
var sw = await _repo.GetSwitchByUuid(switchId);
|
||||
if (sw == null)
|
||||
throw APIErrors.SwitchNotFound;
|
||||
|
||||
var members = _db.Execute(conn => _repo.GetSwitchMembers(conn, sw.Id));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue