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

This commit is contained in:
Lanre Adelowo 2018-12-02 19:07:20 +01:00 committed by Lauris BH
parent 7bc1faabdb
commit c1275e2ba6

View File

@ -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)