Browse Source

Restricted users only see repos in orgs which their team was assigned to (#28025) (#28050)

Backport #28025 by @6543


---
*Sponsored by Kithara Software GmbH*

Co-authored-by: 6543 <m.huber@kithara.com>
tags/v1.20.6
Giteabot 7 months ago
parent
commit
439e071acf
No account linked to committer's email address
1 changed files with 5 additions and 5 deletions
  1. 5
    5
      models/repo/repo_list.go

+ 5
- 5
models/repo/repo_list.go View File

userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType), 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 // 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 return cond

Loading…
Cancel
Save