Skip to content

Commit 073d8c5

Browse files
GiteaBot6543
andauthored
Restricted users only see repos in orgs which their team was assigned to (#28025) (#28051)
Backport #28025 by @6543 --- *Sponsored by Kithara Software GmbH* Co-authored-by: 6543 <[email protected]>
1 parent bc6477b commit 073d8c5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

models/repo/repo_list.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -652,12 +652,12 @@ func AccessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu
652652
userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType),
653653
)
654654
}
655-
cond = cond.Or(
656-
// 4. Repositories that we directly own
657-
builder.Eq{"`repository`.owner_id": user.ID},
655+
// 4. Repositories that we directly own
656+
cond = cond.Or(builder.Eq{"`repository`.owner_id": user.ID})
657+
if !user.IsRestricted {
658658
// 5. Be able to see all public repos in private organizations that we are an org_user of
659-
userOrgPublicRepoCond(user.ID),
660-
)
659+
cond = cond.Or(userOrgPublicRepoCond(user.ID))
660+
}
661661
}
662662

663663
return cond

0 commit comments

Comments
 (0)