aboutsummaryrefslogtreecommitdiffstats
path: root/routers/api
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2018-12-02 17:08:33 +0100
committertechknowlogick <hello@techknowlogick.com>2018-12-02 11:08:33 -0500
commit9441bfaccc54cba214c1892dd2a6bfbb28e17197 (patch)
treed2b46eb43649cc8312cbb17c99d90c8b9faafcdc /routers/api
parentbc42b3ab6c5c8fe234c294804ad0240b1af377dd (diff)
downloadgitea-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.go2
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)