mirror of https://github.com/gogs/gogs.git
api/repo: fix incorrect permission values (#4309)
parent
b3c4a39208
commit
55a5ad5cdc
2
gogs.go
2
gogs.go
|
@ -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
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -1 +1 @@
|
|||
0.10.22.0317
|
||||
0.10.23.0318
|
Loading…
Reference in New Issue