Skip to content

Commit 439e071

Browse files
GiteaBot6543
andauthored
Restricted users only see repos in orgs which their team was assigned to (go-gitea#28025) (go-gitea#28050)
Backport go-gitea#28025 by @6543 --- *Sponsored by Kithara Software GmbH* Co-authored-by: 6543 <[email protected]>
1 parent 69ea554 commit 439e071

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
@@ -637,12 +637,12 @@ func AccessibleRepositoryCondition(user *user_model.User, unitType unit.Type) bu
637637
userOrgTeamUnitRepoCond("`repository`.id", user.ID, unitType),
638638
)
639639
}
640-
cond = cond.Or(
641-
// 4. Repositories that we directly own
642-
builder.Eq{"`repository`.owner_id": user.ID},
640+
// 4. Repositories that we directly own
641+
cond = cond.Or(builder.Eq{"`repository`.owner_id": user.ID})
642+
if !user.IsRestricted {
643643
// 5. Be able to see all public repos in private organizations that we are an org_user of
644-
userOrgPublicRepoCond(user.ID),
645-
)
644+
cond = cond.Or(userOrgPublicRepoCond(user.ID))
645+
}
646646
}
647647

648648
return cond

0 commit comments

Comments
 (0)