summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authora1012112796 <1012112796@qq.com>2021-07-27 06:02:35 +0800
committerGitHub <noreply@github.com>2021-07-27 00:02:35 +0200
commit9102738797ab4a486ab45157d52b2eb7186d9646 (patch)
treeae3475002063a90fd5b0bc3cbd6f786e94341903
parent7c7771e42b2eebd5a698d036c28a21670ff519dd (diff)
downloadgitea-9102738797ab4a486ab45157d52b2eb7186d9646.tar.gz
gitea-9102738797ab4a486ab45157d52b2eb7186d9646.zip
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
-rw-r--r--models/repo_list.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/models/repo_list.go b/models/repo_list.go
index b988ceffac..772bd20be3 100644
--- a/models/repo_list.go
+++ b/models/repo_list.go
@@ -217,16 +217,14 @@ func SearchRepositoryCondition(opts *SearchRepoOptions) builder.Cond {
cond = cond.And(accessibleRepositoryCondition(opts.Actor))
}
} else {
- // Not looking at private organisations
+ // Not looking at private organisations and users
// We should be able to see all non-private repositories that
// isn't in a private or limited organisation.
cond = cond.And(
builder.Eq{"is_private": false},
builder.NotIn("owner_id", builder.Select("id").From("`user`").Where(
- builder.And(
- builder.Eq{"type": UserTypeOrganization},
- builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
- ))))
+ builder.Or(builder.Eq{"visibility": structs.VisibleTypeLimited}, builder.Eq{"visibility": structs.VisibleTypePrivate}),
+ )))
}
if opts.IsPrivate != util.OptionalBoolNone {