diff options
author | 6543 <m.huber@kithara.com> | 2023-11-14 15:23:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-14 15:23:04 +0100 |
commit | 5ab3782f111dfc10378fce403ea5934c4585c2a9 (patch) | |
tree | be4bcd9d231d884d4221cdd32c44cb55f4399835 /models/repo/repo_list.go | |
parent | d4d05f9f1b0e382ad9b7a53ea8c8e0e9afc7b709 (diff) | |
download | gitea-5ab3782f111dfc10378fce403ea5934c4585c2a9.tar.gz gitea-5ab3782f111dfc10378fce403ea5934c4585c2a9.zip |
Restricted users only see repos in orgs which their team was assigned to (#28025)
---
*Sponsored by Kithara Software GmbH*
Diffstat (limited to 'models/repo/repo_list.go')
-rw-r--r-- | models/repo/repo_list.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/models/repo/repo_list.go b/models/repo/repo_list.go index 1668c23c77..533ca5251f 100644 --- a/models/repo/repo_list.go +++ b/models/repo/repo_list.go @@ -652,12 +652,12 @@ func AccessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType), ) } - cond = cond.Or( - // 4. Repositories that we directly own - builder.Eq{"`repository`.owner_id": user.ID}, + // 4. Repositories that we directly own + cond = cond.Or(builder.Eq{"`repository`.owner_id": user.ID}) + if !user.IsRestricted { // 5. Be able to see all public repos in private organizations that we are an org_user of - userOrgPublicRepoCond(user.ID), - ) + cond = cond.Or(userOrgPublicRepoCond(user.ID)) + } } return cond |