forgejo-federation/services/repository
Gergely Nagy ea4071ca9f Allow admins to fork repos even when creation limits are exhausted (#3277)
This is a continuation of #2728, with a test case added.

Fixes #2633.

I kept @zareck 's commit as is, because I believe it is correct. We can't move the check to `owner.CanForkRepo()`, because `owner` is the future owner of the forked repo, and may be an organization. We need to check the admin permission of the `doer`, like in the case of repository creation.

I verified that the test fails without the `ForkRepository` change, and passes with it.

Co-authored-by: Cassio Zareck <cassiomilczareck@gmail.com>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3277
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: Gergely Nagy <forgejo@gergo.csillger.hu>
Co-committed-by: Gergely Nagy <forgejo@gergo.csillger.hu>
2024-04-17 05:52:02 +00:00
..
archiver
commitstatus fix: don't update cache for empty state 2024-04-16 12:02:01 +02:00
files
adopt.go
adopt_test.go
avatar.go Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2023-05-13 20:59:11 +02:00
avatar_test.go
branch.go
cache.go
check.go
collaboration.go
collaboration_test.go
commit.go
contributors_graph.go
contributors_graph_test.go
create.go
create_test.go
delete.go Check the token's owner and repository when registering a runner (#30406) 2024-04-16 09:38:26 +02:00
delete_test.go
fork.go Allow admins to fork repos even when creation limits are exhausted (#3277) 2024-04-17 05:52:02 +00:00
fork_test.go
generate.go
generate_test.go
hooks.go
init.go
lfs.go
lfs_test.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 2023-12-07 15:27:36 +08:00
main_test.go
migrate.go
push.go
repository.go
repository_test.go
review.go
review_test.go
setting.go Fix an actions schedule bug (#28942) 2024-03-25 16:27:32 +01:00
template.go
transfer.go
transfer_test.go