Browse Source

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

tags/v1.7.0-dev
Lanre Adelowo 6 years ago committed by techknowlogick
parent
commit
9441bfaccc
  1. 2
      routers/api/v1/repo/repo.go

2
routers/api/v1/repo/repo.go

@ -502,7 +502,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)

Loading…
Cancel
Save