Skip to content

Commit

Permalink
Hide limited users if viewed by anonymous ghost (go-gitea#25214) (go-…
Browse files Browse the repository at this point in the history
…gitea#25224)

Backport go-gitea#25214 by @KN4CK3R

The ghost user leads to inclusion of limited users/orgs in
`BuildCanSeeUserCondition`.

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit a9ebf91)
  • Loading branch information
GiteaBot authored and earl-warren committed Jun 18, 2023
1 parent a87c620 commit 38e5589
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/packages/container/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,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).
Expand Down

0 comments on commit 38e5589

Please sign in to comment.