mirror of
https://github.com/go-gitea/gitea
synced 2025-08-10 11:38:20 +00:00
Backport #33401 by @lunny Fix #33368 Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -258,9 +258,11 @@ type findForksOptions struct {
|
||||
}
|
||||
|
||||
func (opts findForksOptions) ToConds() builder.Cond {
|
||||
return builder.Eq{"fork_id": opts.RepoID}.And(
|
||||
repo_model.AccessibleRepositoryCondition(opts.Doer, unit.TypeInvalid),
|
||||
)
|
||||
cond := builder.Eq{"fork_id": opts.RepoID}
|
||||
if opts.Doer != nil && opts.Doer.IsAdmin {
|
||||
return cond
|
||||
}
|
||||
return cond.And(repo_model.AccessibleRepositoryCondition(opts.Doer, unit.TypeInvalid))
|
||||
}
|
||||
|
||||
// FindForks returns all the forks of the repository
|
||||
|
Reference in New Issue
Block a user