Skip to content

Commit 7365b4e

Browse files
authored
not show private user's repo in explore view (#16550) (#16554)
after #16069, visibility is also usefull for user, so this limit is not usefull. fix #16545
1 parent e10cd3d commit 7365b4e

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

models/repo_list.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,14 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
217217
cond = cond.And(accessibleRepositoryCondition(opts.Actor))
218218
}
219219
} else {
220-
// Not looking at private organisations
220+
// Not looking at private organisations and users
221221
// We should be able to see all non-private repositories that
222222
// isn't in a private or limited organisation.
223223
cond = cond.And(
224224
builder.Eq{"is_private": false},
225225
builder.NotIn("owner_id", builder.Select("id").From("`user`").Where(
226-
builder.And(
227-
builder.Eq{"type": UserTypeOrganization},
228-
builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
229-
))))
226+
builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
227+
)))
230228
}
231229

232230
if opts.IsPrivate != util.OptionalBoolNone {

0 commit comments

Comments
 (0)