mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-25 21:00:01 +02:00
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`
This commit is contained in:
parent
36c0840cf1
commit
26a0cd7143
3 changed files with 22 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue