aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2023-04-08 00:21:02 +0900
committerGitHub <noreply@github.com>2023-04-07 11:21:02 -0400
commit26a0cd7143cc933cee37ac87696eeda46b1ea437 (patch)
treed56359084e649f7e8f334101800ad83174d513e7 /modules
parent36c0840cf1696912b1872cfa4ebc4b241dabd693 (diff)
downloadgitea-26a0cd7143cc933cee37ac87696eeda46b1ea437.tar.gz
gitea-26a0cd7143cc933cee37ac87696eeda46b1ea437.zip
Allow repo admins too to delete the repo (#23940)
Fixes https://github.com/go-gitea/gitea/issues/23934 We need to check `AccessModeAdmin` in `CanUserDelete` instead of `AccessModeOwner`
Diffstat (limited to 'modules')
-rw-r--r--modules/repository/delete.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/repository/delete.go b/modules/repository/delete.go
index 01674db4a1..72c0dc9135 100644
--- a/modules/repository/delete.go
+++ b/modules/repository/delete.go
@@ -21,11 +21,11 @@ func CanUserDelete(repo *repo_model.Repository, user *user_model.User) (bool, er
}
if repo.Owner.IsOrganization() {
- isOwner, err := organization.OrgFromUser(repo.Owner).IsOwnedBy(user.ID)
+ isAdmin, err := organization.OrgFromUser(repo.Owner).IsOrgAdmin(user.ID)
if err != nil {
return false, err
}
- return isOwner, nil
+ return isAdmin, nil
}
return false, nil