mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-04 16:46:17 +02:00
[models] update GetTeamRepositories to also return repositories accessible via group permissions
This commit is contained in:
parent
e2f5ca92ac
commit
4ef0a905de
@ -30,10 +30,13 @@ type SearchTeamRepoOptions struct {
|
||||
func GetTeamRepositories(ctx context.Context, opts *SearchTeamRepoOptions) (RepositoryList, error) {
|
||||
sess := db.GetEngine(ctx)
|
||||
if opts.TeamID > 0 {
|
||||
sess = sess.In("id",
|
||||
builder.Select("repo_id").
|
||||
From("team_repo").
|
||||
Where(builder.Eq{"team_id": opts.TeamID}),
|
||||
sess = sess.Where(
|
||||
builder.Or(
|
||||
builder.In("id", builder.Select("repo_id").
|
||||
From("team_repo").
|
||||
Where(builder.Eq{"team_id": opts.TeamID}),
|
||||
)),
|
||||
builder.In("id", ReposAccessibleByGroupTeamBuilder(opts.TeamID)),
|
||||
)
|
||||
}
|
||||
if opts.PageSize > 0 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user