Browse Source

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>
tags/v1.20.0-rc1
Giteabot 1 year ago
parent
commit
f64f5495af
No account linked to committer's email address
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      models/packages/container/search.go

+ 4
- 0
models/packages/container/search.go 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).

Loading…
Cancel
Save