aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/repo
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-04-06 01:20:20 -0400
committerUnknwon <u@gogs.io>2017-04-06 01:20:20 -0400
commitf191bff0b9ac11dc7571d1f87c4940afa94a0ce3 (patch)
treea9ac6c1d3b00239d602426db275e735abd53d7a7 /routers/api/v1/repo
parent1a04da864fa24b48fc9a4265bd8f38be509ba14d (diff)
api/repo: check user type of owner for migration
Report by MiaoWoo.
Diffstat (limited to 'routers/api/v1/repo')
-rw-r--r--routers/api/v1/repo/repo.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index e0f62baf..3f0e8025 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
}