aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2023-06-13 05:21:11 +0200
committerGitHub <noreply@github.com>2023-06-13 11:21:11 +0800
commit2126f712bfc0ea63705e54abbd14aec54299fa50 (patch)
tree0c1489a079797c86c01d6dc3d94f9c0542d16403 /models
parent139704f4994f8a960351cd19f66b262e53cc9f6d (diff)
downloadgitea-2126f712bfc0ea63705e54abbd14aec54299fa50.tar.gz
gitea-2126f712bfc0ea63705e54abbd14aec54299fa50.zip
Hide limited users if viewed by anonymous ghost (#25214)
The ghost user leads to inclusion of limited users/orgs in `BuildCanSeeUserCondition`.
Diffstat (limited to 'models')
-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).