diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-12-02 17:08:33 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2018-12-02 11:08:33 -0500 |
commit | 9441bfaccc54cba214c1892dd2a6bfbb28e17197 (patch) | |
tree | d2b46eb43649cc8312cbb17c99d90c8b9faafcdc /routers/api | |
parent | bc42b3ab6c5c8fe234c294804ad0240b1af377dd (diff) | |
download | gitea-9441bfaccc54cba214c1892dd2a6bfbb28e17197.tar.gz gitea-9441bfaccc54cba214c1892dd2a6bfbb28e17197.zip |
admin should be able to delete repos even if he is not a member of the organization (#5443)
Diffstat (limited to 'routers/api')
-rw-r--r-- | routers/api/v1/repo/repo.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index 6d8125a77f..d78700c6b0 100644 --- a/routers/api/v1/repo/repo.go +++ b/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) |