Skip to content

Commit a9ebf91

Browse files
GiteaBotKN4CK3R
andauthored
Hide limited users if viewed by anonymous ghost (go-gitea#25214) (go-gitea#25224)
Backport go-gitea#25214 by @KN4CK3R The ghost user leads to inclusion of limited users/orgs in `BuildCanSeeUserCondition`. Co-authored-by: KN4CK3R <[email protected]>
1 parent de6ac4b commit a9ebf91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/packages/container/search.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ func GetRepositories(ctx context.Context, actor *user_model.User, n int, last st
271271
cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
272272
}
273273

274+
if actor.IsGhost() {
275+
actor = nil
276+
}
277+
274278
cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
275279

276280
sess := db.GetEngine(ctx).

0 commit comments

Comments
 (0)