aboutsummaryrefslogtreecommitdiffstats
path: root/routers/web
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-08-21 18:24:05 +0200
committerGitHub <noreply@github.com>2022-08-21 17:24:05 +0100
commit0b4c166e8a90beeb1e71ee2fc16b3a240517c82d (patch)
tree607869cf2ed3caf90cb9981ab04a8fbba8e58043 /routers/web
parent6d3181406d87503dbd15e4a7c764c8963f13977f (diff)
downloadgitea-0b4c166e8a90beeb1e71ee2fc16b3a240517c82d.tar.gz
gitea-0b4c166e8a90beeb1e71ee2fc16b3a240517c82d.zip
Fix SQL Query for `SearchTeam` (#20844)
- Currently the function takes in the `UserID` option, but isn't being used within the SQL query. This patch fixes that by checking that only teams are being returned that the user belongs to. Fix #20829 Co-authored-by: delvh <dev.lh@web.de>
Diffstat (limited to 'routers/web')
-rw-r--r--routers/web/org/teams.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/org/teams.go b/routers/web/org/teams.go
index 9ee66a1a3e..a3c3acb4f4 100644
--- a/routers/web/org/teams.go
+++ b/routers/web/org/teams.go
@@ -339,7 +339,7 @@ func SearchTeam(ctx *context.Context) {
}
opts := &organization.SearchTeamOptions{
- UserID: ctx.Doer.ID,
+ // UserID is not set because the router already requires the doer to be an org admin. Thus, we don't need to restrict to teams that the user belongs in
Keyword: ctx.FormTrim("q"),
OrgID: ctx.Org.Organization.ID,
IncludeDesc: ctx.FormString("include_desc") == "" || ctx.FormBool("include_desc"),