summaryrefslogtreecommitdiffstats
path: root/models/org.go
diff options
context:
space:
mode:
authorHugo Hoitink <10838836+hoitih@users.noreply.github.com>2022-06-16 01:24:10 +0200
committerGitHub <noreply@github.com>2022-06-16 02:24:10 +0300
commit6473bd333a54f38f333920a6e567edafe6692ff5 (patch)
tree5aeb8544dd3e467e37e9bc71327c063bba42eda8 /models/org.go
parent881646520e6eb81303dc6cac9c1003e96a024103 (diff)
downloadgitea-6473bd333a54f38f333920a6e567edafe6692ff5.tar.gz
gitea-6473bd333a54f38f333920a6e567edafe6692ff5.zip
In code search, get code unit accessible repos in one (main) query (#19764)
* When non-admin users use code search, get code unit accessible repos in one main query * Modified some comments to match the changes * Removed unnecessary check for Access Mode in Collaboration table Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to 'models/org.go')
-rw-r--r--models/org.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/models/org.go b/models/org.go
index 009fe758b5..849c9b985b 100644
--- a/models/org.go
+++ b/models/org.go
@@ -14,6 +14,7 @@ import (
"code.gitea.io/gitea/models/organization"
access_model "code.gitea.io/gitea/models/perm/access"
repo_model "code.gitea.io/gitea/models/repo"
+ "code.gitea.io/gitea/models/unit"
user_model "code.gitea.io/gitea/models/user"
"xorm.io/builder"
@@ -54,7 +55,7 @@ func GetUserOrgsList(user *user_model.User) ([]*MinimalOrg, error) {
Join("LEFT", builder.
Select("id as repo_id, owner_id as repo_owner_id").
From("repository").
- Where(repo_model.AccessibleRepositoryCondition(user)), "`repository`.repo_owner_id = `team`.org_id").
+ Where(repo_model.AccessibleRepositoryCondition(user, unit.TypeInvalid)), "`repository`.repo_owner_id = `team`.org_id").
Where("`team_user`.uid = ?", user.ID).
GroupBy(groupByStr)