diff options
author | Unknwon <u@gogs.io> | 2017-03-18 16:44:40 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-18 16:44:40 -0400 |
commit | 55a5ad5cdcbe6906f863d0b7f27d1ee500720416 (patch) | |
tree | 1d8b2204ff8ca9d9d2bb0938ad839a3356fb54a7 | |
parent | b3c4a39208331fd3798923bde01bf556b9e90c0d (diff) |
api/repo: fix incorrect permission values (#4309)
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | routers/api/v1/api.go | 2 | ||||
-rw-r--r-- | routers/api/v1/repo/repo.go | 6 | ||||
-rw-r--r-- | routers/user/auth.go | 5 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
5 files changed, 11 insertions, 6 deletions
@@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.10.22.0317" +const APP_VER = "0.10.23.0318" func init() { setting.AppVer = APP_VER diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 49c1ee59..6a9c5441 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -242,7 +242,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/repos", func() { m.Post("/migrate", bind(form.MigrateRepo{}), repo.Migrate) - m.Combo("/:username/:reponame").Get(repo.Get). + m.Combo("/:username/:reponame", repoAssignment()).Get(repo.Get). Delete(repo.Delete) m.Group("/:username/:reponame", func() { diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go index a491e7ce..7ff47a2d 100644 --- a/routers/api/v1/repo/repo.go +++ b/routers/api/v1/repo/repo.go @@ -309,7 +309,11 @@ func Get(ctx *context.APIContext) { return } - ctx.JSON(200, repo.APIFormat(&api.Permission{true, true, true})) + ctx.JSON(200, repo.APIFormat(&api.Permission{ + Admin: ctx.Repo.IsAdmin(), + Push: ctx.Repo.IsWriter(), + Pull: true, + })) } // https://github.com/gogits/go-gogs-client/wiki/Repositories#delete diff --git a/routers/user/auth.go b/routers/user/auth.go index 5833a63b..87fc03ba 100644 --- a/routers/user/auth.go +++ b/routers/user/auth.go @@ -274,8 +274,9 @@ func Activate(ctx *context.Context) { ctx.Data["Hours"] = setting.Service.ActiveCodeLives / 60 mailer.SendActivateAccountMail(ctx.Context, models.NewMailerUser(ctx.User)) - if err := ctx.Cache.Put("MailResendLimit_"+ctx.User.LowerName, ctx.User.LowerName, 180); err != nil { - log.Error(4, "Set cache(MailResendLimit) fail: %v", err) + keyName := "MailResendLimit_" + ctx.User.LowerName + if err := ctx.Cache.Put(keyName, ctx.User.LowerName, 180); err != nil { + log.Error(2, "Set cache '%s' fail: %v", keyName, err) } } } else { diff --git a/templates/.VERSION b/templates/.VERSION index 984e5b15..7fd49db0 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.10.22.0317
\ No newline at end of file +0.10.23.0318
\ No newline at end of file |