mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-01 07:09:21 +01:00
261fc87673
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
|
||
---|---|---|
.. | ||
actions | ||
agit | ||
asymkey | ||
attachment | ||
auth | ||
automerge | ||
context | ||
contexttest | ||
convert | ||
cron | ||
doctor | ||
externalaccount | ||
feed | ||
forgejo | ||
forms | ||
gitdiff | ||
indexer | ||
issue | ||
lfs | ||
mailer | ||
markup | ||
migrations | ||
mirror | ||
notify | ||
org | ||
packages | ||
pull | ||
release | ||
repository | ||
secrets | ||
task | ||
uinotification | ||
user | ||
webhook | ||
wiki |