diff options
author | Giteabot <teabot@gitea.io> | 2023-06-13 01:53:26 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-13 13:53:26 +0800 |
commit | f64f5495af50750349e187475c282f1f700beafc (patch) | |
tree | 44da6484d8aee7cac14e5fa2081c97296620ca9c /models/packages | |
parent | 3e9fc3672902adc8f2c589d034aa3772f06825e2 (diff) | |
download | gitea-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.go | 4 |
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). |