diff --git a/PluralKit.API/Controllers/v2/GroupControllerV2.cs b/PluralKit.API/Controllers/v2/GroupControllerV2.cs index 62db4525..aa932127 100644 --- a/PluralKit.API/Controllers/v2/GroupControllerV2.cs +++ b/PluralKit.API/Controllers/v2/GroupControllerV2.cs @@ -21,9 +21,6 @@ public class GroupControllerV2: PKControllerBase var ctx = ContextFor(system); - if (with_members && !system.MemberListPrivacy.CanAccess(ctx)) - throw Errors.UnauthorizedMemberList; - if (!system.GroupListPrivacy.CanAccess(ContextFor(system))) throw Errors.UnauthorizedGroupList; @@ -34,17 +31,14 @@ public class GroupControllerV2: PKControllerBase .Select(g => g.ToJson(ctx, needsMembersArray: with_members)) .ToListAsync(); - if (with_members && !system.MemberListPrivacy.CanAccess(ctx)) - throw Errors.UnauthorizedMemberList; - if (with_members && j_groups.Count > 0) { var q = await _repo.GetGroupMemberInfo(await groups .Where(g => g.Visibility.CanAccess(ctx)) + .Where(g => g.ListPrivacy.CanAccess(ctx)) .Select(x => x.Id) .ToListAsync()); - foreach (var row in q) if (row.MemberVisibility.CanAccess(ctx)) ((JArray)j_groups.Find(x => x.Value("id") == row.Group)["members"]).Add(row.MemberUuid); @@ -151,4 +145,4 @@ public class GroupControllerV2: PKControllerBase return NoContent(); } -} \ No newline at end of file +}