1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-11-21 08:31:27 -05:00

Hide limited users if viewed by anonymous ghost (#25214)

The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.
This commit is contained in:
KN4CK3R 2023-06-13 05:21:11 +02:00 committed by GitHub
parent 139704f499
commit 2126f712bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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).