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 authored and Lauris BH committed 2018-12-02 20:07:20 +02:00
1 parent 7bc1faabdb
commit c1275e2ba6
1 file changed
+1 -1
+1 -1
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)