mirror of
https://github.com/go-gitea/gitea
synced 2025-07-14 14:37:20 +00:00
Fix system admin cannot fork or get private fork with API (#33401)
Fix #33368
This commit is contained in:
@ -256,9 +256,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