diff options
author | Unknwon <joe2010xtmf@163.com> | 2014-12-12 20:30:32 -0500 |
---|---|---|
committer | Unknwon <joe2010xtmf@163.com> | 2014-12-12 20:30:32 -0500 |
commit | ac4a10456ea4515091c3c90a83a82c1e59cdf428 (patch) | |
tree | db68f1f7a8f290322bd4da9892487cca5a1a5843 /routers/repo | |
parent | 2f3a7e53cb58e922055baf3cf14138100a1f05ac (diff) | |
download | gitea-ac4a10456ea4515091c3c90a83a82c1e59cdf428.tar.gz gitea-ac4a10456ea4515091c3c90a83a82c1e59cdf428.zip |
api: able to create repo and fix #726
- POST /user/repos
- POST /org/:org/repos
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/repo.go | 8 | ||||
-rw-r--r-- | routers/repo/setting.go | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/routers/repo/repo.go b/routers/repo/repo.go index 8e4ace9940..70b0c05ece 100644 --- a/routers/repo/repo.go +++ b/routers/repo/repo.go @@ -97,14 +97,14 @@ func CreatePost(ctx *middleware.Context, form auth.CreateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } } repo, err := models.CreateRepository(ctxUser, form.RepoName, form.Description, - form.Gitignore, form.License, form.Private, false, form.InitReadme) + form.Gitignore, form.License, form.Private, false, form.AutoInit) if err == nil { log.Trace("Repository created: %s/%s", ctxUser.Name, repo.Name) ctx.Redirect(setting.AppSubUrl + "/" + ctxUser.Name + "/" + repo.Name) @@ -174,7 +174,7 @@ func MigratePost(ctx *middleware.Context, form auth.MigrateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } @@ -292,7 +292,7 @@ func ForkPost(ctx *middleware.Context, form auth.CreateRepoForm) { if ctxUser.IsOrganization() { // Check ownership of organization. - if !ctxUser.IsOrgOwner(ctx.User.Id) { + if !ctxUser.IsOwnedBy(ctx.User.Id) { ctx.Error(403) return } diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 94c642b2b2..aec79aa436 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -137,7 +137,7 @@ func SettingsPost(ctx *middleware.Context, form auth.RepoSettingForm) { } if ctx.Repo.Owner.IsOrganization() { - if !ctx.Repo.Owner.IsOrgOwner(ctx.User.Id) { + if !ctx.Repo.Owner.IsOwnedBy(ctx.User.Id) { ctx.Error(404) return } |