diff --git a/PluralKit.API/Controllers/v2/GroupControllerV2.cs b/PluralKit.API/Controllers/v2/GroupControllerV2.cs index 25c88127..39dabd02 100644 --- a/PluralKit.API/Controllers/v2/GroupControllerV2.cs +++ b/PluralKit.API/Controllers/v2/GroupControllerV2.cs @@ -39,7 +39,11 @@ public class GroupControllerV2: PKControllerBase if (with_members && j_groups.Count > 0) { - var q = await _repo.GetGroupMemberInfo(await groups.Select(x => x.Id).ToListAsync()); + var q = await _repo.GetGroupMemberInfo(await groups + .Where(g => g.Visibility.CanAccess(ctx)) + .Select(x => x.Id) + .ToListAsync()); + foreach (var row in q) if (row.MemberVisibility.CanAccess(ctx)) @@ -147,4 +151,4 @@ public class GroupControllerV2: PKControllerBase return NoContent(); } -} \ No newline at end of file +}