forgejo/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 Count downloads for tag archives 2024-04-08 12:51:27 +02:00
commitstatus fix: don't update cache for empty state 2024-04-16 12:02:01 +02:00
files Merge pull request '[BUG] Use correct empty commit ID' (#3247) from gusted/forgejo-sha256-index into forgejo 2024-04-16 06:26:23 +00:00
adopt.go
adopt_test.go
avatar.go
avatar_test.go
branch.go
cache.go
check.go
collaboration.go
collaboration_test.go
commit.go
contributors_graph.go [BUG] Store JSON in contributors commit cache 2024-04-11 13:01:33 +02:00
contributors_graph_test.go [BUG] Store JSON in contributors commit cache 2024-04-11 13:01:33 +02:00
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 Refactor LFS GC functions 2024-04-05 16:49:15 +02:00
lfs_test.go
main_test.go
migrate.go
push.go Do not update PRs based on events that happened before they existed 2024-04-11 11:16:23 +02:00
repository.go
repository_test.go
review.go
review_test.go
setting.go
template.go
transfer.go
transfer_test.go