diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2018-12-02 19:07:20 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-12-02 20:07:20 +0200 |
commit | c1275e2ba62449ac55f545aacb03edf13d02fd72 (patch) | |
tree | e9d44151088b8e3e48d9ca62cb9eeac373934f90 /routers | |
parent | 7bc1faabdbe073741bf413eace202d9585bb409b (diff) | |
download | gitea-c1275e2ba62449ac55f545aacb03edf13d02fd72.tar.gz gitea-c1275e2ba62449ac55f545aacb03edf13d02fd72.zip |
Admin should be able to delete repos even if he is not a member of the organization (#5443) (#5447)
Diffstat (limited to 'routers')
-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 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) |