summaryrefslogtreecommitdiffstats
path: root/models/packages
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2023-06-13 01:53:26 -0400
committerGitHub <noreply@github.com>2023-06-13 13:53:26 +0800
commitf64f5495af50750349e187475c282f1f700beafc (patch)
tree44da6484d8aee7cac14e5fa2081c97296620ca9c /models/packages
parent3e9fc3672902adc8f2c589d034aa3772f06825e2 (diff)
downloadgitea-f64f5495af50750349e187475c282f1f700beafc.tar.gz
gitea-f64f5495af50750349e187475c282f1f700beafc.zip
Hide limited users if viewed by anonymous ghost (#25214) (#25220)
Backport #25214 by @KN4CK3R The ghost user leads to inclusion of limited users/orgs in `BuildCanSeeUserCondition`. Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'models/packages')
-rw-r--r--models/packages/container/search.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/packages/container/search.go b/models/packages/container/search.go
index 0d3664d384..9a16b3ae44 100644
--- a/models/packages/container/search.go
+++ b/models/packages/container/search.go
@@ -262,6 +262,10 @@ func GetRepositories(ctx context.Context, actor *user_model.User, n int, last st
cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
}
+ if actor.IsGhost() {
+ actor = nil
+ }
+
cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
sess := db.GetEngine(ctx).