Skip to content

Commit 2126f71

Browse files
authored
Hide limited users if viewed by anonymous ghost (#25214)
The ghost user leads to inclusion of limited users/orgs in `BuildCanSeeUserCondition`.
1 parent 139704f commit 2126f71

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