Skip to content

Commit f64f549

Browse files
GiteaBotKN4CK3R
andauthored
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>
1 parent 3e9fc36 commit f64f549

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/packages/container/search.go

+4
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ func GetRepositories(ctx context.Context, actor *user_model.User, n int, last st
262262
cond = cond.And(builder.Gt{"package_property.value": strings.ToLower(last)})
263263
}
264264

265+
if actor.IsGhost() {
266+
actor = nil
267+
}
268+
265269
cond = cond.And(user_model.BuildCanSeeUserCondition(actor))
266270

267271
sess := db.GetEngine(ctx).

0 commit comments

Comments
 (0)