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 Use db.ListOptionsAll instead of db.ListOptions{ListAll: true} (#29995) 2024-03-26 19:04:27 +01:00
adopt_test.go
avatar.go
avatar_test.go
branch.go Merge pull request '[ACTIONS] port scheduled actions from Gitea' (#2826) from earl-warren/forgejo:wip-gitea-schedule into forgejo 2024-03-27 06:23:56 +00:00
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 Move get/set default branch from git package to gitrepo package to hide repopath (#29126) 2024-03-11 23:36:59 +07:00
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 Move get/set default branch from git package to gitrepo package to hide repopath (#29126) 2024-03-11 23:36:59 +07:00
generate_test.go Move generate from module to service (#29465) 2024-03-06 12:10:44 +08:00
hooks.go
init.go Move generate from module to service (#29465) 2024-03-06 12:10:44 +08:00
lfs.go Refactor LFS GC functions 2024-04-05 16:49:15 +02:00
lfs_test.go
main_test.go
migrate.go Move get/set default branch from git package to gitrepo package to hide repopath (#29126) 2024-03-11 23:36:59 +07:00
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 Fix an actions schedule bug (#28942) 2024-03-25 16:27:32 +01:00
template.go Move generate from module to service (#29465) 2024-03-06 12:10:44 +08:00
transfer.go
transfer_test.go