1
1
mirror of https://github.com/go-gitea/gitea synced 2024-06-01 17:05:48 +00:00

admin should be able to delete repos even if he is not a member of the organization (#5443)

This commit is contained in:
Lanre Adelowo 2018-12-02 17:08:33 +01:00 committed by techknowlogick
parent bc42b3ab6c
commit 9441bfaccc

View File

@ -502,7 +502,7 @@ func Delete(ctx *context.APIContext) {
owner := ctx.Repo.Owner owner := ctx.Repo.Owner
repo := ctx.Repo.Repository repo := ctx.Repo.Repository
if owner.IsOrganization() { if owner.IsOrganization() && !ctx.User.IsAdmin {
isOwner, err := owner.IsOwnedBy(ctx.User.ID) isOwner, err := owner.IsOwnedBy(ctx.User.ID)
if err != nil { if err != nil {
ctx.Error(500, "IsOwnedBy", err) ctx.Error(500, "IsOwnedBy", err)