forgejo/services/repository
Gergely Nagy 261fc87673 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>
(cherry picked from commit ea4071ca9f)
2024-04-17 06:06:48 +00:00
..
archiver Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
commitstatus fix commit_status 2024-03-24 07:11:19 +01:00
files Merge pull request '[v1.22/gitea] week 16 cherry pick to v7.0' (#3235) from earl-warren/forgejo:wip-v7.0-gitea-cherry-pick into v7.0/forgejo 2024-04-16 09:31:46 +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 Use more specific test methods (#24265) 2023-04-22 17:56:27 -04:00
avatar.go Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2023-05-13 20:59:11 +02:00
avatar_test.go Use context parameter in services/repository (#23186) 2023-02-28 16:17:51 -06:00
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 Always enable caches (#28527) 2023-12-19 09:29:05 +00:00
check.go Update tool dependencies (#29030) 2024-02-02 19:11:39 -05:00
collaboration.go Fix DeleteCollaboration transaction behaviour (#28886) 2024-01-22 07:19:56 +00:00
collaboration_test.go Next round of db.DefaultContext refactor (#27089) 2023-09-16 14:39:12 +00:00
commit.go Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
contributors_graph.go [BUG] Store JSON in contributors commit cache 2024-04-11 12:06:19 +00:00
contributors_graph_test.go [BUG] Store JSON in contributors commit cache 2024-04-11 12:06:19 +00: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 [CLEANUP] make golangci-lint@v1.56.1 happy 2024-02-15 16:19:36 +01:00
delete.go Use db.Find instead of writing methods for every object (#28084) 2023-11-24 03:49:41 +00:00
delete_test.go Delete repos of org when purge delete user (#27273) 2023-10-19 13:16:11 +00:00
fork.go Allow admins to fork repos even when creation limits are exhausted (#3277) 2024-04-17 06:06:48 +00:00
fork_test.go Add option to prohibit fork if user reached maximum limit of repositories (#21848) 2022-12-27 15:21:14 -06:00
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 Simplify how git repositories are opened (#28937) 2024-01-27 21:09:51 +01:00
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-06 07:41:40 +00:00
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 make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
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-12 10:41:19 +02:00
repository.go Remove unnecessary parameter (#27671) 2023-10-18 15:03:10 +00:00
repository_test.go refactor some functions to support ctx as first parameter (#21878) 2022-12-03 10:48:26 +08:00
review.go Use context parameter in services/repository (#23186) 2023-02-28 16:17:51 -06:00
review_test.go Use context parameter in services/repository (#23186) 2023-02-28 16:17:51 -06:00
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 [MODERATION] User blocking 2024-02-05 15:56:45 +01:00
transfer_test.go [MODERATION] User blocking 2024-02-05 15:56:45 +01:00