From 1246721523aaabfe14f00473228fca08e5f180c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=99=E2=97=A6=20The=20Tablet=20=E2=9D=80=20GamerGirla?= =?UTF-8?q?ndCo=20=E2=97=A6=E2=9D=A7?= Date: Fri, 27 Dec 2024 23:39:02 -0500 Subject: [PATCH] add condition and builder functions to be used when searching for groups --- models/group/group_list.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/models/group/group_list.go b/models/group/group_list.go index 5715accb5c..d855f0143e 100644 --- a/models/group/group_list.go +++ b/models/group/group_list.go @@ -58,10 +58,8 @@ func AccessibleGroupCondition(user *user_model.User, unitType unit.Type) builder if user == nil || user.ID <= 0 { orgVisibilityLimit = append(orgVisibilityLimit, structs.VisibleTypeLimited) } - // 1. Be able to see all non-private groups that either: cond = cond.Or(builder.And( builder.Eq{"`repo_group`.is_private": false}, - // 2. Aren't in an private organisation or limited organisation if we're not logged in builder.NotIn("`repo_group`.owner_id", builder.Select("id").From("`user`").Where( builder.And( builder.Eq{"type": user_model.UserTypeOrganization}, @@ -69,15 +67,11 @@ func AccessibleGroupCondition(user *user_model.User, unitType unit.Type) builder )))) } if user != nil { - // 2. Be able to see all repositories that we have unit independent access to - // 3. Be able to see all repositories through team membership(s) if unitType == unit.TypeInvalid { - // Regardless of UnitType cond = cond.Or( UserOrgTeamGroupCond("`repo_group`.id", user.ID), ) } else { - // For a specific UnitType cond = cond.Or( userOrgTeamUnitGroupCond("`repo_group`.id", user.ID, unitType), )