aboutsummaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
authorJonas Franz <info@jonasfranz.software>2017-09-18 16:52:20 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-09-18 22:52:20 +0800
commit566e8ecce0df27e09d9f3ed9503f788827cc1102 (patch)
treea48ae27031a1d62aaa20a4ac2a44b0bb332bbd73 /routers/routes
parent6c6533fb31bbc82e7907b1dc233212045849569b (diff)
downloadgitea-566e8ecce0df27e09d9f3ed9503f788827cc1102.tar.gz
gitea-566e8ecce0df27e09d9f3ed9503f788827cc1102.zip
Fork permission bug fixes (#2534)
* Hotfix for "Add time manually" (https://github.com/go-gitea/gitea/pull/2211#issuecomment-328780125) Signed-off-by: Jonas Franz <info@jonasfranz.software> * Checking if Code unit is enabled before creating a fork. Signed-off-by: Jonas Franz <info@jonasfranz.software> * Adding a discrete function for RepoIDAssignment Signed-off-by: Jonas Franz <info@jonasfranz.software> * Improved Documentation
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index a0684c8478..c5d6793ff3 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -419,8 +419,10 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost)
m.Get("/migrate", repo.Migrate)
m.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), repo.MigratePost)
- m.Combo("/fork/:repoid").Get(repo.Fork).
- Post(bindIgnErr(auth.CreateRepoForm{}), repo.ForkPost)
+ m.Group("/fork", func() {
+ m.Combo("/:repoid").Get(repo.Fork).
+ Post(bindIgnErr(auth.CreateRepoForm{}), repo.ForkPost)
+ }, context.RepoIDAssignment(), context.UnitTypes(), context.LoadRepoUnits(), context.CheckUnit(models.UnitTypeCode))
}, reqSignIn)
m.Group("/:username/:reponame", func() {