Fix so that user can still fork his own repository to owned organizations (#2699)

* Fix so that user can still fork his own repository to his organizations

* Fix to only use owned organizations

* Add integration test for forking own repository to owned organization
This commit is contained in:
Lauris BH 2017-10-15 18:06:07 +03:00 committed by GitHub
parent 32ca299650
commit 1ec4dc6c1d
8 changed files with 88 additions and 29 deletions

View file

@ -337,6 +337,11 @@ func RepoAssignment() macaron.Handler {
ctx.Data["IsRepositoryAdmin"] = ctx.Repo.IsAdmin()
ctx.Data["IsRepositoryWriter"] = ctx.Repo.IsWriter()
if ctx.Data["CanSignedUserFork"], err = ctx.Repo.Repository.CanUserFork(ctx.User); err != nil {
ctx.Handle(500, "CanUserFork", err)
return
}
ctx.Data["DisableSSH"] = setting.SSH.Disabled
ctx.Data["ExposeAnonSSH"] = setting.SSH.ExposeAnonymous
ctx.Data["DisableHTTP"] = setting.Repository.DisableHTTPGit