]> source.dussan.org Git - gitea.git/commit
Refactor find forks and fix possible bugs that weak permissions check (#32528)
authorLunny Xiao <xiaolunwen@gmail.com>
Mon, 18 Nov 2024 03:06:25 +0000 (19:06 -0800)
committerGitHub <noreply@github.com>
Mon, 18 Nov 2024 03:06:25 +0000 (03:06 +0000)
commit4f879a00df029e09b40f64bf8de0572704766115
treebb6d9b0b70fdc1d4e92e298355f244f52e831930
parentf122aaf9ff627515922a68782339725e2d7c079a
Refactor find forks and fix possible bugs that weak permissions check (#32528)

- Move models/GetForks to services/FindForks
- Add doer as a parameter of FindForks to check permissions
- Slight performance optimization for get forks API with batch loading
of repository units
- Add tests for forking repository to organizations

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
models/repo/fork.go
models/repo/repo_list.go
routers/api/v1/repo/fork.go
routers/web/repo/view.go
services/repository/fork.go
templates/repo/forks.tmpl
tests/integration/api_fork_test.go
tests/integration/repo_fork_test.go