From c1275e2ba62449ac55f545aacb03edf13d02fd72 Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Sun, 2 Dec 2018 19:07:20 +0100 Subject: Admin should be able to delete repos even if he is not a member of the organization (#5443) (#5447) --- routers/api/v1/repo/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers') diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index e48b100af6..2238998e41 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -508,7 +508,7 @@ func Delete(ctx *context.APIContext) { owner := ctx.Repo.Owner repo := ctx.Repo.Repository - if owner.IsOrganization() { + if owner.IsOrganization() && !ctx.User.IsAdmin { isOwner, err := owner.IsOwnedBy(ctx.User.ID) if err != nil { ctx.Error(500, "IsOwnedBy", err) -- cgit v1.2.3