From f191bff0b9ac11dc7571d1f87c4940afa94a0ce3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 6 Apr 2017 01:20:20 -0400 Subject: [PATCH] api/repo: check user type of owner for migration Report by MiaoWoo. --- routers/api/v1/repo/repo.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index e0f62baf5..3f0e8025d 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -220,6 +220,9 @@ func Migrate(ctx *context.APIContext, f form.MigrateRepo) { ctx.Error(500, "GetUserByID", err) } return + } else if !org.IsOrganization() { + ctx.Error(403, "", err) + return } ctxUser = org }