diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2025-01-29 21:40:44 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-30 05:40:44 +0000 |
commit | f88dbf86b326966a4628f4d3d7986590f544336e (patch) | |
tree | ac7527af8ac0b5b98ff3b84d3294d494b0d19ecf /services/notify | |
parent | 48183d2b05e2f71f16289d994a11c5fa0e6b4e69 (diff) | |
download | gitea-f88dbf86b326966a4628f4d3d7986590f544336e.tar.gz gitea-f88dbf86b326966a4628f4d3d7986590f544336e.zip |
Refactor repository transfer (#33211)
- Both have `RejectTransfer` and `CancelTransfer` because the permission
checks are not the same. `CancelTransfer` can be done by the doer or
those who have admin permission to access this repository.
`RejectTransfer` can be done by the receiver user if it's an individual
or those who can create repositories if it's an organization.
- Some tests are wrong, this PR corrects them.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/notify')
-rw-r--r-- | services/notify/notify.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/notify/notify.go b/services/notify/notify.go index 3b5f24340b..c97d0fcbaf 100644 --- a/services/notify/notify.go +++ b/services/notify/notify.go @@ -272,9 +272,9 @@ func MigrateRepository(ctx context.Context, doer, u *user_model.User, repo *repo } // TransferRepository notifies create repository to notifiers -func TransferRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, newOwnerName string) { +func TransferRepository(ctx context.Context, doer *user_model.User, repo *repo_model.Repository, oldOwnerName string) { for _, notifier := range notifiers { - notifier.TransferRepository(ctx, doer, repo, newOwnerName) + notifier.TransferRepository(ctx, doer, repo, oldOwnerName) } } |