Skip to content

Commit 9102738

Browse files
authoredJul 26, 2021
not show private user's repo in explore view (#16550)
after #16069, visibility is also usefull for user, so this limit is not usefull. fix #16545
1 parent 7c7771e commit 9102738

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed
 

‎models/repo_list.go

+3-5
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)
Please sign in to comment.